Cleanup metadata godoc

The godoc should properly show the formatting of the database
structure and sections explaining it.

Signed-off-by: Derek McGowan <derek@mcg.dev>
This commit is contained in:
Derek McGowan
2024-06-19 20:16:57 -07:00
parent 741c4bde51
commit 2f1bf791b9

View File

@@ -28,113 +28,114 @@
// //
// <version>/<namespace>/<object>/<key> -> <field> // <version>/<namespace>/<object>/<key> -> <field>
// //
// version: Currently, this is "v1". Additions can be made to v1 in a backwards // version
// compatible way. If the layout changes, a new version must be made, along // Currently, this is "v1". Additions can be made to v1 in a backwards
// with a migration. // compatible way. If the layout changes, a new version must be made,
// along with a migration.
// //
// namespace: the namespace to which this object belongs. // namespace
// The namespace to which this object belongs.
// //
// object: defines which object set is stored in the bucket. There are two // object
// special objects, "labels" and "indexes". The "labels" bucket stores the // Defines which object set is stored in the bucket. There are two
// labels for the parent namespace. The "indexes" object is reserved for // special objects, "labels" and "indexes". The "labels" bucket
// indexing objects, if we require in the future. // stores the labels for the parent namespace. The "indexes" object
// is reserved for indexing objects, if we require in the future.
// //
// key: object-specific key identifying the storage bucket for the objects // key
// contents. // Object-specific key identifying the storage bucket for the
// object's contents.
// //
// Below is the current database schema. This should be updated each time // Below is the current database schema. This should be updated each time
// the structure is changed in addition to adding a migration and incrementing // the structure is changed in addition to adding a migration and incrementing
// the database version. // the database version.
// Notes:
// //
// - `╘══*...*` refers to maps with arbitrary keys // Notes
// • `╘══*...*` refers to maps with arbitrary keys
// • `version` is a key to a numeric value identifying the minor revisions
// of schema version
// • a namespace in a schema bucket cannot be named "version"
// //
// - `version` is a key to a numeric value identifying the minor revisions // Schema
// of schema version // └──v1 - Schema version bucket
// // ├──version : <varint> - Latest version, see migrations
// - a namespace in a schema bucket cannot be named "version" // ╘══*namespace*
// // ├──labels
/* // │ ╘══*key* : <string> - Label value
└──v1 - Schema version bucket // ├──image
├──version : <varint> - Latest version, see migrations // ╘══*image name*
╘══*namespace* // │ ├──createdat : <binary time> - Created at
├──labels // │ ├──updatedat : <binary time> - Updated at
╘══*key* : <string> - Label value // │ ├──target
├──image // │ │ ├──digest : <digest> - Descriptor digest
│ ╘══*image name* // │ │ ├──mediatype : <string> - Descriptor media type
│ ├──createdat : <binary time> - Created at // │ │ └──size : <varint> - Descriptor size
│ ├──updatedat : <binary time> - Updated at // │ └──labels
│ ├──target // │ ╘══*key* : <string> - Label value
├──digest : <digest> - Descriptor digest // ├──containers
├──mediatype : <string> - Descriptor media type // ╘══*container id*
└──size : <varint> - Descriptor size // ├──createdat : <binary time> - Created at
──labels // ──updatedat : <binary time> - Updated at
│ ╘══*key* : <string> - Label value // │ ├──spec : <binary> - Proto marshaled spec
├──containers // │ ├──image : <string> - Image name
│ ╘══*container id* // │ ├──snapshotter : <string> - Snapshotter name
│ ├──createdat : <binary time> - Created at // │ ├──snapshotKey : <string> - Snapshot key
│ ├──updatedat : <binary time> - Updated at // │ ├──runtime
│ ├──spec : <binary> - Proto marshaled spec // │ │ ├──name : <string> - Runtime name
│ ├──image : <string> - Image name // │ │ └──options : <binary> - Proto marshaled options
│ ├──snapshotter : <string> - Snapshotter name // │ ├──extensions
│ ├──snapshotKey : <string> - Snapshot key // │ │ ╘══*name* : <binary> - Proto marshaled extension
──runtime // ──labels
├──name : <string> - Runtime name // ╘══*key* : <string> - Label value
│ │ └──options : <binary> - Proto marshaled options // ├──snapshots
│ ├──extensions // │ ╘══*snapshotter*
│ ╘══*name* : <binary> - Proto marshaled extension // │ ╘══*snapshot key*
│ └──labels // │ ├──name : <string> - Snapshot name in backend
│ ╘══*key* : <string> - Label value // │ ├──createdat : <binary time> - Created at
├──snapshots // │ ├──updatedat : <binary time> - Updated at
│ ╘══*snapshotter* // │ ├──parent : <string> - Parent snapshot name
│ ╘══*snapshot key* // │ ├──children
├──name : <string> - Snapshot name in backend // │ ╘══*snapshot key* : <nil> - Child snapshot reference
──createdat : <binary time> - Created at // ──labels
├──updatedat : <binary time> - Updated at // ╘══*key* : <string> - Label value
├──parent : <string> - Parent snapshot name // ├──content
├──children // ├──blob
│ ╘══*snapshot key* : <nil> - Child snapshot reference // │ ╘══*blob digest*
│ └──labels // │ │ ├──createdat : <binary time> - Created at
╘══*key* : <string> - Label value // ├──updatedat : <binary time> - Updated at
├──content // │ │ ├──size : <varint> - Blob size
│ ├──blob // │ │ └──labels
│ │ ╘══*blob digest* // │ │ ╘══*key* : <string> - Label value
──createdat : <binary time> - Created at // ──ingests
├──updatedat : <binary time> - Updated at // ╘══*ingest reference*
├──size : <varint> - Blob size // ├──ref : <string> - Ingest reference in backend
──labels // ──expireat : <binary time> - Time to expire ingest
╘══*key* : <string> - Label value // └──expected : <digest> - Expected commit digest
──ingests // ──sandboxes
╘══*ingest reference* // ╘══*sandbox id*
├──ref : <string> - Ingest reference in backend // ├──createdat : <binary time> - Created at
├──expireat : <binary time> - Time to expire ingest // ├──updatedat : <binary time> - Updated at
│ └──expected : <digest> - Expected commit digest // │ ├──spec : <binary> - Proto marshaled spec
├──sandboxes // │ ├──sandboxer : <string> - Sandboxer name
│ ╘══*sandbox id* // │ ├──runtime
│ ├──createdat : <binary time> - Created at // ├──name : <string> - Runtime name
│ ├──updatedat : <binary time> - Updated at // │ │ └──options : <binary> - Proto marshaled options
│ ├──spec : <binary> - Proto marshaled spec // │ ├──extensions
│ ├──sandboxer : <string> - Sandboxer name // │ │ ╘══*name* : <binary> - Proto marshaled extension
──runtime // ──labels
├──name : <string> - Runtime name // ╘══*key* : <string> - Label value
└──options : <binary> - Proto marshaled options // └──leases
├──extensions // ╘══*lease id*
╘══*name* : <binary> - Proto marshaled extension // ├──createdat : <binary time> - Created at
──labels // ──labels
╘══*key* : <string> - Label value // ╘══*key* : <string> - Label value
└──leases // ├──snapshots
╘══*lease id* // │ ╘══*snapshotter*
├──createdat : <binary time> - Created at // │ ╘══*snapshot key* : <nil> - Snapshot reference
├──labels // ├──content
│ ╘══*key* : <string> - Label value // │ ╘══*blob digest* : <nil> - Content blob reference
├──snapshots // └─────ingests
╘══*snapshotter* // ╘══*ingest reference* : <nil> - Content ingest reference
│ ╘══*snapshot key* : <nil> - Snapshot reference
├──content
│ ╘══*blob digest* : <nil> - Content blob reference
└─────ingests
╘══*ingest reference* : <nil> - Content ingest reference
*/
package metadata package metadata
import ( import (