client

package
v0.0.0-...-69a7a08 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2015 License: BSD-3-Clause Imports: 14 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) *Client

func (Client) DownloadTarget

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

func (Client) GetTargetsFile

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

func (Client) RoleTargetsPath

func (c Client) RoleTargetsPath(roleName string, snapshotMeta data.Files, consistent bool) (string, error)

func (Client) TargetMeta

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

func (*Client) Update

func (c *Client) Update() error

Update an in memory copy of the TUF Repo. If an error is returned, the Client instance should be considered corrupted and discarded as it may be left in a partially updated state

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