Documentation ¶
Index ¶
Constants ¶
View Source
const Version = "0.2.3"
Version is the updater version
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Asset ¶
type Asset struct { // Name of file. Name string `json:"name"` // URL to request from. URL string `json:"url"` // Digest is hex encoded digest. Digest string `json:"digest"` // DigestType is sha256 by default. Also supports "sha512". DigestType string `json:"digestType"` // LocalPath is where downloaded file resides. LocalPath string `json:"localPath"` }
Asset describes a downloadable file
type ContextLogger ¶
type ContextLogger interface { Debugf(ctx context.Context, format string, args ...interface{}) Infof(ctx context.Context, format string, args ...interface{}) Warningf(ctx context.Context, format string, args ...interface{}) Errorf(ctx context.Context, format string, args ...interface{}) }
ContextLogger interface used in this package with request context.
type Logger ¶
type Logger interface { Debugf(format string, args ...interface{}) Infof(format string, args ...interface{}) Warningf(format string, args ...interface{}) Errorf(format string, args ...interface{}) Fatalf(format string, args ...interface{}) }
Logger interface used in this package.
type Property ¶
type Property struct { Name string `codec:"name" json:"name"` Value string `codec:"value" json:"value"` }
Property is a generic key value pair for custom properties
type Update ¶
type Update struct { Version string `json:"version"` PublishedAt int64 `json:"publishedAt"` Props []Property `codec:"props" json:"props,omitempty"` Asset *Asset `json:"asset,omitempty"` NeedUpdate bool `json:"needUpdate"` Applied string `json:"applied"` }
Update describes an update. If update is needed, NeedUpdate will be true. If update is downloaded, Asset.LocalPath will be set. If update was applied, Applied is set to the destination.
type UpdateOptions ¶
type UpdateOptions struct { // Version is the current version of the app Version string `json:"version"` // AppName is name of the app AppName string `json:"appName"` // Prerelease will request latest prerelease Prerelease bool `json:"prerelease"` }
UpdateOptions are options used to find an update
type UpdateSource ¶
type UpdateSource interface { // Description is a short description about the update source Description() string // FindUpdate finds an update given options FindUpdate(options UpdateOptions) (*Update, error) }
UpdateSource defines where the updater can find updates
type Updater ¶
type Updater struct {
// contains filtered or unexported fields
}
Updater knows how to find and apply updates
func (*Updater) CheckForUpdate ¶
func (u *Updater) CheckForUpdate(options UpdateOptions) (*Update, error)
CheckForUpdate checks a update source for an update.
Click to show internal directories.
Click to hide internal directories.