Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ApplyUpdate = apply_update
* Replace binary
View Source
var ErrorNoUpdateAvailable error = fmt.Errorf("no update available")
Functions ¶
This section is empty.
Types ¶
type CheckParams ¶
type CheckResult ¶
type CheckResult struct { CheckParams Url string `json:"url"` Version string `json:"version"` Checksum string `json:"checksum"` }
type Client ¶
type Client struct {
Endpoint string
}
func (*Client) CheckForUpdate ¶
func (c *Client) CheckForUpdate(params CheckParams) (*CheckResult, error)
func (*Client) GetUpdate ¶
func (c *Client) GetUpdate(r *CheckResult) (io.ReadCloser, error)
type Updater ¶
type Updater struct { Params CheckParams // contains filtered or unexported fields }
func New ¶
*
- Basic options to initialize the struct
- options["version"] = if version is 0, it will be set to 1 (check.go)
- options["appName"] = identifier of the application to update
- options["updateUri"] = update server uri
func (*Updater) Check ¶
func (u *Updater) Check() (*CheckResult, error)
func (*Updater) CheckAndUpdate ¶
* Check for new updates and replace binary
func (*Updater) Update ¶
func (u *Updater) Update(r *CheckResult) error
Click to show internal directories.
Click to hide internal directories.