{"id":24211484,"url":"https://github.com/go-api-libs/types","last_synced_at":"2025-07-19T16:35:52.398Z","repository":{"id":263077601,"uuid":"874929517","full_name":"go-api-libs/types","owner":"go-api-libs","description":"A collection of commonly used data types in API contexts (e.g. email), ensuring correct marshalling, unmarshalling, and validation.","archived":false,"fork":false,"pushed_at":"2024-12-22T14:57:38.000Z","size":396,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-03T16:22:00.510Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/go-api-libs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-18T18:14:02.000Z","updated_at":"2024-12-23T11:17:12.000Z","dependencies_parsed_at":"2024-11-16T02:23:59.892Z","dependency_job_id":"1f13f2da-4b07-4134-aecc-dd49f774321c","html_url":"https://github.com/go-api-libs/types","commit_stats":null,"previous_names":["go-api-libs/types"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/go-api-libs/types","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-api-libs%2Ftypes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-api-libs%2Ftypes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-api-libs%2Ftypes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-api-libs%2Ftypes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/go-api-libs","download_url":"https://codeload.github.com/go-api-libs/types/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-api-libs%2Ftypes/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265966281,"owners_count":23857057,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-14T02:35:24.301Z","updated_at":"2025-07-19T16:35:52.355Z","avatar_url":"https://github.com/go-api-libs.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Types\n[![Go Reference](https://pkg.go.dev/badge/github.com/go-api-libs/types.svg)](https://pkg.go.dev/github.com/go-api-libs/types)\n[![Go Report Card](https://goreportcard.com/badge/github.com/go-api-libs/types)](https://goreportcard.com/report/github.com/go-api-libs/types)\n![Code Coverage](https://img.shields.io/badge/coverage-100%25-brightgreen)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](./LICENSE)\n\nThis library offers a collection of commonly used data types in API contexts, ensuring correct marshalling, unmarshalling, and validation. By standardizing these types across all our API libraries, we aim to reduce redundancy, increase consistency, and enhance type safety.\n\n## Features\n\n- **Standardized Types**: Tailored for API data interchange\n- **Validation**: Built-in validation rules to ensure data integrity before processing or transmission.\n- **JSON Marshalling/Unmarshalling**: Custom JSON handling for each type to handle special cases (e.g., ensuring email addresses are formatted correctly).\n- **Used Across go-api-libs**: These types are employed by all API libraries within the [go-api-libs](https://github.com/go-api-libs/) organization for consistency.\n\n## Installation\n\nTo install the library, use the following command:\n\n```shell\ngo get github.com/go-api-libs/types\n```\n\n## Usage\n\nWhen using any of the API libraries from the [go-api-libs](https://github.com/go-api-libs/) organization, you can trust that types in successful API responses are valid.\n\nBeyond that, here's how you can use some types from this library:\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/go-api-libs/types\"\n)\n\nfunc main() {\n\t// Using Email type\n\temail := types.Email(\"user@example.com\")\n\tif err := email.Validate(); err != nil {\n\t\tfmt.Println(err)\n\t} else {\n\t\tfmt.Println(\"Valid email address\")\n\t}\n}\n```\n\n## Contributing\n\nIf you have any contributions to make, please submit a pull request or open an issue on the [GitHub repository](https://github.com/go-api-libs/types).\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](./LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-api-libs%2Ftypes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgo-api-libs%2Ftypes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-api-libs%2Ftypes/lists"}