Documentation ¶
Index ¶
- func DBStore(db *sql.DB, imageName string) *dbStore
- func NewFilesystemStore(baseDir, metaSubDir, metaExtension, targetsSubDir string) (*filesystemStore, error)
- func NewMemoryStore(meta map[string][]byte, files map[string][]byte) *memoryStore
- type ErrMaliciousServer
- type ErrMetaNotFound
- type ErrServerUnavailable
- type ErrShortRead
- type HTTPStore
- func (s HTTPStore) GetKey(role string) ([]byte, error)
- func (s HTTPStore) GetMeta(name string, size int64) ([]byte, error)
- func (s HTTPStore) GetTarget(path string) (io.ReadCloser, error)
- func (s HTTPStore) SetMeta(name string, blob []byte) error
- func (s HTTPStore) SetMultiMeta(metas map[string][]byte) error
- type LocalStore
- type MetadataStore
- type PublicKeyStore
- type RemoteStore
- type TargetStore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewFilesystemStore ¶
Types ¶
type ErrMaliciousServer ¶
type ErrMaliciousServer struct{}
func (ErrMaliciousServer) Error ¶
func (err ErrMaliciousServer) Error() string
type ErrMetaNotFound ¶
type ErrMetaNotFound struct{}
func (ErrMetaNotFound) Error ¶
func (err ErrMetaNotFound) Error() string
type ErrServerUnavailable ¶
type ErrServerUnavailable struct {
// contains filtered or unexported fields
}
func (ErrServerUnavailable) Error ¶
func (err ErrServerUnavailable) Error() string
type ErrShortRead ¶
type ErrShortRead struct{}
func (ErrShortRead) Error ¶
func (err ErrShortRead) Error() string
type HTTPStore ¶
type HTTPStore struct {
// contains filtered or unexported fields
}
HTTPStore manages pulling and pushing metadata from and to a remote service over HTTP. It assumes the URL structure of the remote service maps identically to the structure of the TUF repo: <baseURL>/<metaPrefix>/(root|targets|snapshot|timestamp).json <baseURL>/<targetsPrefix>/foo.sh
If consistent snapshots are disabled, it is advised that caching is not enabled. Simple set a cachePath (and ensure it's writeable) to enable caching.
func NewHTTPStore ¶
func NewHTTPStore(baseURL, metaPrefix, metaExtension, targetsPrefix, keyExtension string, roundTrip http.RoundTripper) (*HTTPStore, error)
func (HTTPStore) GetMeta ¶
GetMeta downloads the named meta file with the given size. A short body is acceptable because in the case of timestamp.json, the size is a cap, not an exact length.
type LocalStore ¶
type LocalStore interface { MetadataStore TargetStore }
type MetadataStore ¶
type PublicKeyStore ¶
type RemoteStore ¶
type RemoteStore interface { MetadataStore PublicKeyStore GetTarget(path string) (io.ReadCloser, error) }
type TargetStore ¶
[endophage] I'm of the opinion this should go away.