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