1package storage 2 3import ( 4 "github.com/theupdateframework/notary/tuf/data" 5) 6 7// NoSizeLimit is represented as -1 for arguments to GetMeta 8const NoSizeLimit int64 = -1 9 10// MetadataStore must be implemented by anything that intends to interact 11// with a store of TUF files 12type MetadataStore interface { 13 GetSized(name string, size int64) ([]byte, error) 14 Set(name string, blob []byte) error 15 SetMulti(map[string][]byte) error 16 RemoveAll() error 17 Remove(name string) error 18} 19 20// PublicKeyStore must be implemented by a key service 21type PublicKeyStore interface { 22 GetKey(role data.RoleName) ([]byte, error) 23 RotateKey(role data.RoleName) ([]byte, error) 24} 25 26// RemoteStore is similar to LocalStore with the added expectation that it should 27// provide a way to download targets once located 28type RemoteStore interface { 29 MetadataStore 30 PublicKeyStore 31} 32 33// Bootstrapper is a thing that can set itself up 34type Bootstrapper interface { 35 // Bootstrap instructs a configured Bootstrapper to perform 36 // its setup operations. 37 Bootstrap() error 38} 39