Documentation ¶
Index ¶
Constants ¶
View Source
const (
// DataTypeStructure describes a blob entry that contains a structure.
DataTypeStructure = "struct"
)
Variables ¶
View Source
var ( // ErrShutdown is returned when a action is attempted against a store that // is shutdown. ErrShutdown = errors.New("store is shutdown") )
Functions ¶
Types ¶
type BlobEntry ¶
type BlobEntry struct { Digest string `json:"digest"` // SHA256 digest of data, hex encoded DataHint string `json:"datahint"` // Hint that describes data, base64 encoded Data string `json:"data"` // Data payload, base64 encoded }
BlobEntry is the structure used to store data in the key-value store.
func NewBlobEntry ¶
NewBlobEntry returns a new BlobEntry.
type BlobKV ¶
type BlobKV interface { // Put saves the provided key-value entries to the database. New entries are // inserted. Existing entries are updated. // // This operation is atomic. Put(blobs map[string][]byte, encrypt bool) error // Del deletes the key-value entries from the database for the provided keys. // // This operation is atomic. Del(keys []string) error // Get retrieves the key-value entries from the database for the provided // keys. // // An entry will not exist in the returned map for any blobs that are not // found. It is the responsibility of the caller to ensure a blob was // returned for all provided keys. Get(keys []string) (map[string][]byte, error) // Close closes the database connection. Close() }
BlobKV represents a blob key-value store.
type DataDescriptor ¶
type DataDescriptor struct { Type string `json:"type"` // Type of data Descriptor string `json:"descriptor"` // Description of the data ExtraData string `json:"extradata,omitempty"` // Value to be freely used }
DataDescriptor provides hints about a data blob. In practice we JSON encode this struture and stuff it into BlobEntry.DataHint.
Click to show internal directories.
Click to hide internal directories.