Ecosyste.ms: Packages

An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

Top 7.7% on proxy.golang.org
Top 0.4% dependent packages on proxy.golang.org
Top 0.7% dependent repos on proxy.golang.org
Top 1.1% docker downloads on proxy.golang.org

proxy.golang.org : github.com/kevinburke/go-types

Package types implements several types for dealing with REST API's and databases. UUID's are very useful, but you often need to attach context to them; e.g. you cannot look at a UUID and know whether it points to a record in the accounts table or in the messages table. A PrefixUUID solves this problem, by embedding the additional useful information as part of the string. If we had to write this value to the database as a string it would take up 43 bytes. Instead we use a UUID type and strip the prefix before saving it. The converse, Value(), only returns the UUID part by default, since this is the only thing the database knows about. You can also attach the prefix manually in your SQL, like so: This will get parsed as part of the Scan(), and then you don't need to do anything. Alternatively, you can attach the prefix in your model, immediately after the query. A NullString is like the null string in `database/sql`, but can additionally be encoded/decoded via JSON. A NullTime behaves exactly like NullString, but the value is a time.Time.

Registry - Source - Documentation - JSON
purl: pkg:golang/github.com/kevinburke/go-types
License: MIT
Latest release: almost 3 years ago
First release: almost 3 years ago
Namespace: github.com/kevinburke
Dependent packages: 153
Dependent repositories: 80
Stars: 0 on GitHub
Forks: 2 on GitHub
Docker dependents: 25
Docker downloads: 3,447
See more repository details: repos.ecosyste.ms
Funding links: https://github.com/sponsors/kevinburke
Last synced: 7 days ago

    Loading...
    Readme
    Loading...