Ecosyste.ms: Packages

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

Top 8.2% on proxy.golang.org

proxy.golang.org : github.com/kr/genbolt

Command genbolt generates code for conveniently reading and writing objects in a bolt database. It reads a set of Go type definitions describing the layout of data in a bolt database, and generates code for reading and writing that data. The following types are stored as records: The following types are stored as buckets: All other types are not supported. For example, here is a schema definition: Here, Root is the root bucket. Field Users leads to a bucket indexed by an automatically incrementing uint64, holding all user records. Type User is a bucket representing a single user. Field Config leads to the single Config bucket, holding a single number. This schema produces the following package interface (with some definitions elided): Named types from other packages can be used, provided they're accompanied by a variable declaration in the schema asserting that they satisfy either json.Marshaler or encoding.BinaryMarshaler. Such types must also satisfy json.Unmarshaler or encoding.BinaryUnmarshaler, respectively, but this does not need to appear in the schema. Values of those types are marshaled when written and unmarshaled again when read. It is conventional to put a +build ignore directive in the schema file, so it can live in the same directory as the generated code without its symbols conflicting.

Registry - Source - Documentation - JSON
purl: pkg:golang/github.com/kr/genbolt
License: MIT
Latest release: over 5 years ago
First release: over 5 years ago
Namespace: github.com/kr
Stars: 3 on GitHub
Forks: 1 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: 28 days ago

    Loading...
    Readme
    Loading...