client

package
v0.0.0-...-9bcdad0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 4, 2015 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoRootKeys       = errors.New("tuf: no root keys found in local meta store")
	ErrInsufficientKeys = errors.New("tuf: insufficient keys to meet threshold")
)

Functions

func IsLatestSnapshot

func IsLatestSnapshot(err error) bool

func IsNotFound

func IsNotFound(err error) bool

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(local *tuf.TufRepo, remote store.RemoteStore, keysDB *keys.KeyDB, cache store.MetadataStore) *Client

func (Client) DownloadTarget

func (c Client) DownloadTarget(dst io.Writer, path string, meta *data.FileMeta) error

func (Client) GetTargetsFile

func (c Client) GetTargetsFile(role string, keyIDs []string, snapshotMeta data.Files, consistent bool, threshold int) (*data.Signed, error)

func (Client) RoleTargetsPath

func (c Client) RoleTargetsPath(role string, hashSha256 string, consistent bool) (string, error)

RoleTargetsPath generates the appropriate filename for the targets file, based on whether the repo is marked as consistent.

func (Client) TargetMeta

func (c Client) TargetMeta(path string) (*data.FileMeta, error)

TargetMeta ensures the repo is up to date, downloading the minimum necessary metadata files

func (*Client) Update

func (c *Client) Update() error

type ErrCorruptedCache

type ErrCorruptedCache struct {
	// contains filtered or unexported fields
}

func (ErrCorruptedCache) Error

func (e ErrCorruptedCache) Error() string

type ErrDecodeFailed

type ErrDecodeFailed struct {
	File string
	Err  error
}

func (ErrDecodeFailed) Error

func (e ErrDecodeFailed) Error() string

type ErrDownloadFailed

type ErrDownloadFailed struct {
	File string
	Err  error
}

func (ErrDownloadFailed) Error

func (e ErrDownloadFailed) Error() string

type ErrInvalidURL

type ErrInvalidURL struct {
	URL string
}

func (ErrInvalidURL) Error

func (e ErrInvalidURL) Error() string

type ErrLatestSnapshot

type ErrLatestSnapshot struct {
	Version int
}

func (ErrLatestSnapshot) Error

func (e ErrLatestSnapshot) Error() string

type ErrMetaTooLarge

type ErrMetaTooLarge struct {
	Name string
	Size int64
}

func (ErrMetaTooLarge) Error

func (e ErrMetaTooLarge) Error() string

type ErrMissingRemoteMetadata

type ErrMissingRemoteMetadata struct {
	Name string
}

func (ErrMissingRemoteMetadata) Error

func (e ErrMissingRemoteMetadata) Error() string

type ErrNotFound

type ErrNotFound struct {
	File string
}

func (ErrNotFound) Error

func (e ErrNotFound) Error() string

type ErrUnknownTarget

type ErrUnknownTarget struct {
	Name string
}

func (ErrUnknownTarget) Error

func (e ErrUnknownTarget) Error() string

type ErrWrongSize

type ErrWrongSize struct {
	File     string
	Actual   int64
	Expected int64
}

func (ErrWrongSize) Error

func (e ErrWrongSize) Error() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL