client

package
v0.0.0-...-3b700e2 Latest Latest
Warning

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

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

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")
)

Simple client errors

Functions

func IsNotFound

func IsNotFound(err error) bool

IsNotFound - check if an error is an ErrNotFound type

Types

type Client

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

Client is a usability wrapper around a raw TUF repo

func NewClient

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

NewClient initialized a Client with the given repo, remote source of content, key database, and cache

func (Client) DownloadTarget

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

DownloadTarget downloads the target to dst from the remote

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

Update performs an update to the TUF repo as defined by the TUF spec

type ErrChecksumMismatch

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

ErrChecksumMismatch - a checksum failed verification

func (ErrChecksumMismatch) Error

func (e ErrChecksumMismatch) Error() string

type ErrCorruptedCache

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

ErrCorruptedCache - local data is incorrect

func (ErrCorruptedCache) Error

func (e ErrCorruptedCache) Error() string

type ErrDecodeFailed

type ErrDecodeFailed struct {
	File string
	Err  error
}

ErrDecodeFailed - couldn't parse a download

func (ErrDecodeFailed) Error

func (e ErrDecodeFailed) Error() string

type ErrDownloadFailed

type ErrDownloadFailed struct {
	File string
	Err  error
}

ErrDownloadFailed - a download failed

func (ErrDownloadFailed) Error

func (e ErrDownloadFailed) Error() string

type ErrMissingMeta

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

ErrMissingMeta - couldn't find the FileMeta object for a role or target

func (ErrMissingMeta) Error

func (e ErrMissingMeta) Error() string

type ErrMissingRemoteMetadata

type ErrMissingRemoteMetadata struct {
	Name string
}

ErrMissingRemoteMetadata - remote didn't have requested metadata

func (ErrMissingRemoteMetadata) Error

func (e ErrMissingRemoteMetadata) Error() string

type ErrNotFound

type ErrNotFound struct {
	File string
}

ErrNotFound - didn't find a file

func (ErrNotFound) Error

func (e ErrNotFound) Error() string

type ErrWrongSize

type ErrWrongSize struct {
	File     string
	Actual   int64
	Expected int64
}

ErrWrongSize - the size is wrong

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