client

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2020 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadLocalMetadata added in v0.0.4

func LoadLocalMetadata(path string, metadata *manifiesta.Metadata) error

func MergeMetadata added in v0.0.4

func MergeMetadata(local, remote manifiesta.Metadata) manifiesta.Metadata

MergeMetadata preserves key fields that should not be updated remotely.

func SaveLocalMetadata added in v0.0.4

func SaveLocalMetadata(path string, metadata manifiesta.Metadata) error

func VerifyManifest

func VerifyManifest(manifest manifiesta.Manifest) error

checks for absolute pathing

Types

type Downloader added in v0.0.4

type Downloader struct {
	Manifest   manifiesta.Manifest
	Progresser Progresser
	Logger     *log.Logger
}

func NewDownloader added in v0.0.4

func NewDownloader(manifest manifiesta.Manifest, progresser Progresser) *Downloader

func (*Downloader) CheckAndUpdate added in v0.0.4

func (d *Downloader) CheckAndUpdate() error

CheckAndUpdate checks and updates every file on the manifest

func (*Downloader) CheckAndUpdateFile added in v0.0.4

func (d *Downloader) CheckAndUpdateFile(file manifiesta.File) error

CheckAndUpdateFile checks and updates a single file on the manifest

func (*Downloader) CheckFile added in v0.0.4

func (d *Downloader) CheckFile(file manifiesta.File) (bool, error)

CheckFile checks a local path to see it exists and matches the given sha256 hash

type HttpError

type HttpError struct {
	StatusCode int
	Message    string
}

func (HttpError) Error

func (e HttpError) Error() string

type ManifestClient

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

func NewManifestClient

func NewManifestClient(url string) *ManifestClient

func (*ManifestClient) GetManifest

func (c *ManifestClient) GetManifest(name string, manifest *manifiesta.Manifest) (bool, error)

func (*ManifestClient) GetMetadata added in v0.0.4

func (c *ManifestClient) GetMetadata(name string, metadata *manifiesta.Metadata) (bool, error)

type Progresser added in v0.0.4

type Progresser interface {
	New(text string, size int64)
	Update(n int64)
	Complete()
}

Progresser is an interface to update progress

type SourceReader added in v0.0.4

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

func NewSourceReader added in v0.0.4

func NewSourceReader(source manifiesta.Source) (*SourceReader, error)

func (*SourceReader) Close added in v0.0.4

func (r *SourceReader) Close() error

func (*SourceReader) Read added in v0.0.4

func (r *SourceReader) Read(p []byte) (int, error)

Jump to

Keyboard shortcuts

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