Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FileCacheStore ¶
type FileCacheStore struct { RemoteStore // contains filtered or unexported fields }
FileCacheStore implements a super simple wrapper around RemoteStore to handle local file caching of metadata
func NewFileCacheStore ¶
func NewFileCacheStore(remote RemoteStore, cachePath string) *FileCacheStore
func (FileCacheStore) GetMeta ¶
func (s FileCacheStore) GetMeta(name string, size int64) (json.RawMessage, error)
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 (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 }
func MemoryStore ¶
func MemoryStore(meta map[string]json.RawMessage, files map[string][]byte) LocalStore
type MetadataStore ¶
type MetadataStore interface { GetMeta(name string, size int64) (json.RawMessage, error) SetMeta(name string, blob json.RawMessage) error }
func NewFilesystemStore ¶
func NewFilesystemStore(baseDir, metaSubDir, metaExtension, targetsSubDir string) (MetadataStore, error)
type RemoteStore ¶
type RemoteStore interface { MetadataStore GetTarget(path string) (io.ReadCloser, error) }
type TargetStore ¶
[endophage] I'm of the opinion this should go away.