Merge pull request #10370 from dmcgowan/metadata-godoc

Cleanup metadata godoc
This commit is contained in:
Maksym Pavlenko
2024-06-20 20:24:05 +00:00
committed by GitHub

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 // `version` is a key to a numeric value identifying the minor revisions
// of schema version // of schema version
// • a namespace in a schema bucket cannot be named "version"
// //
// - a namespace in a schema bucket cannot be named "version" // Schema
// // └──v1 - Schema version bucket
/* // ├──version : <varint> - Latest version, see migrations
└──v1 - Schema version bucket // ╘══*namespace*
├──version : <varint> - Latest version, see migrations // ├──labels
╘══*namespace* // ╘══*key* : <string> - Label value
├──labels // ├──image
│ ╘══*key* : <string> - Label value // │ ╘══*image name*
├──image // │ ├──createdat : <binary time> - Created at
│ ╘══*image name* // │ ├──updatedat : <binary time> - Updated at
│ ├──createdat : <binary time> - Created at // │ ├──target
│ ├──updatedat : <binary time> - Updated at // ├──digest : <digest> - Descriptor digest
│ ├──target // ├──mediatype : <string> - Descriptor media type
│ │ ──digest : <digest> - Descriptor digest // │ │ ──size : <varint> - Descriptor size
├──mediatype : <string> - Descriptor media type // └──labels
└──size : <varint> - Descriptor size // ╘══*key* : <string> - Label value
──labels // ──containers
╘══*key* : <string> - Label value // ╘══*container id*
├──containers // │ ├──createdat : <binary time> - Created at
│ ╘══*container id* // │ ├──updatedat : <binary time> - Updated at
│ ├──createdat : <binary time> - Created at // │ ├──spec : <binary> - Proto marshaled spec
│ ├──updatedat : <binary time> - Updated at // │ ├──image : <string> - Image name
│ ├──spec : <binary> - Proto marshaled spec // │ ├──snapshotter : <string> - Snapshotter name
│ ├──image : <string> - Image name // │ ├──snapshotKey : <string> - Snapshot key
│ ├──snapshotter : <string> - Snapshotter name // │ ├──runtime
│ ├──snapshotKey : <string> - Snapshot key // ├──name : <string> - Runtime name
│ ├──runtime // │ │ └──options : <binary> - Proto marshaled options
├──name : <string> - Runtime name // │ ├──extensions
│ │ └──options : <binary> - Proto marshaled options // │ │ ╘══*name* : <binary> - Proto marshaled extension
──extensions // ──labels
│ ╘══*name* : <binary> - Proto marshaled extension // ╘══*key* : <string> - Label value
└──labels // ├──snapshots
╘══*key* : <string> - Label value // ╘══*snapshotter*
├──snapshots // │ ╘══*snapshot key*
│ ╘══*snapshotter* // │ ├──name : <string> - Snapshot name in backend
│ ╘══*snapshot key* // │ ├──createdat : <binary time> - Created at
│ ├──name : <string> - Snapshot name in backend // │ ├──updatedat : <binary time> - Updated at
│ ├──createdat : <binary time> - Created at // │ ├──parent : <string> - Parent snapshot name
│ ├──updatedat : <binary time> - Updated at // │ ├──children
├──parent : <string> - Parent snapshot name // │ ╘══*snapshot key* : <nil> - Child snapshot reference
──children // ──labels
╘══*snapshot key* : <nil> - Child snapshot reference // ╘══*key* : <string> - Label value
└──labels // ├──content
│ ╘══*key* : <string> - Label value // │ ├──blob
├──content // │ │ ╘══*blob digest*
│ ├──blob // │ │ ├──createdat : <binary time> - Created at
│ │ ╘══*blob digest* // │ │ ├──updatedat : <binary time> - Updated at
│ │ ├──createdat : <binary time> - Created at // │ │ ├──size : <varint> - Blob size
│ │ ──updatedat : <binary time> - Updated at // │ │ ──labels
│ │ ├──size : <varint> - Blob size // │ │ ╘══*key* : <string> - Label value
└──labels // └──ingests
╘══*key* : <string> - Label value // ╘══*ingest reference*
│ └──ingests // │ ├──ref : <string> - Ingest reference in backend
│ ╘══*ingest reference* // │ ├──expireat : <binary time> - Time to expire ingest
──ref : <string> - Ingest reference in backend // ──expected : <digest> - Expected commit digest
├──expireat : <binary time> - Time to expire ingest // ├──sandboxes
└──expected : <digest> - Expected commit digest // ╘══*sandbox id*
├──sandboxes // │ ├──createdat : <binary time> - Created at
│ ╘══*sandbox id* // │ ├──updatedat : <binary time> - Updated at
│ ├──createdat : <binary time> - Created at // │ ├──spec : <binary> - Proto marshaled spec
│ ├──updatedat : <binary time> - Updated at // │ ├──sandboxer : <string> - Sandboxer name
│ ├──spec : <binary> - Proto marshaled spec // │ ├──runtime
│ ├──sandboxer : <string> - Sandboxer name // │ │ ├──name : <string> - Runtime name
│ ├──runtime // │ │ └──options : <binary> - Proto marshaled options
├──name : <string> - Runtime name // │ ├──extensions
│ │ └──options : <binary> - Proto marshaled options // │ │ ╘══*name* : <binary> - Proto marshaled extension
──extensions // ──labels
╘══*name* : <binary> - Proto marshaled extension // ╘══*key* : <string> - Label value
└──labels // └──leases
╘══*key* : <string> - Label value // ╘══*lease id*
└──leases // ├──createdat : <binary time> - Created at
╘══*lease id* // ├──labels
├──createdat : <binary time> - Created at // │ ╘══*key* : <string> - Label value
├──labels // ├──snapshots
│ ╘══*key* : <string> - Label value // │ ╘══*snapshotter*
├──snapshots // │ ╘══*snapshot key* : <nil> - Snapshot reference
│ ╘══*snapshotter* // ├──content
╘══*snapshot key* : <nil> - Snapshot reference // ╘══*blob digest* : <nil> - Content blob reference
├──content // └─────ingests
│ ╘══*blob digest* : <nil> - Content blob reference // ╘══*ingest reference* : <nil> - Content ingest reference
└─────ingests
╘══*ingest reference* : <nil> - Content ingest reference
*/
package metadata package metadata
import ( import (