Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( errors.New("provider not avaiable") // ErrFileNotFound is a generic error when a file is not found ErrFileNotFound = errors.New("file not found") )ErrProviderUnavaiable =
Functions ¶
This section is empty.
Types ¶
type AccessProvider ¶
type AccessProvider interface { GetLatestVersion() (string, error) // Get the latest version (Should be accessible even if Open() was not called) Walk(walkFn WalkFunc) error Retrieve(srcPath string, destPath string) error }
AccessProvider describes the access methods of a Provider This methods shouldn't change the state of the provider
type Github ¶
type Github struct { RepositoryURL string // Repository URL, example github.com/mouuff/go-rocket-update ZipName string // Zip name (the zip you upload for a release on github), example: binaries.zip // contains filtered or unexported fields }
Github provider finds a zip file in the repository's releases to provide files
func (*Github) GetLatestVersion ¶
GetLatestVersion gets the latest version
type Local ¶
type Local struct {
Path string // Path of the folder
}
A Local provider use a local directory to provide files This provider is mainly here for mocking and testing but it could be used on a shared network folder
func (*Local) GetLatestVersion ¶
GetLatestVersion gets the latest version
type Provider ¶
type Provider interface { AccessProvider Open() error Close() error }
A Provider describes an interface for providing files
type Secure ¶
type Secure struct { BackendProvider Provider PublicKey *rsa.PublicKey // contains filtered or unexported fields }
Secure provider defines a provider which verifies the signature of files when Retrieve() is called
func (*Secure) GetLatestVersion ¶
GetLatestVersion gets the latest version
type WalkFunc ¶
WalkFunc is the type of the function called for each file or directory visited by Walk. path is relative