Documentation ¶
Index ¶
Constants ¶
View Source
const ( INITIATIVE_NEVER Initiative = "never" INITIATIVE_AUTO = "auto" INITIATIVE_MANUAL = "manual" )
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Params ¶
type Params struct { // protocol version Version int `json:"version"` // identifier of the application to update AppId string `json:"app_id"` // version of the application updating itself AppVersion string `json:"app_version"` // operating system of target platform OS string `json:"-"` // hardware architecture of target platform Arch string `json:"-"` // application-level user identifier UserId string `json:"user_id"` // checksum of the binary to replace (used for returning diff patches) Checksum string `json:"checksum"` // release channel (empty string means 'stable') Channel string `json:"-"` // tags for custom update channels Tags map[string]string `json:"tags"` }
func (*Params) CheckAndApplyUpdate ¶
func (*Params) CheckForUpdate ¶
CheckForUpdate makes an HTTP post to a URL with the JSON serialized representation of Params. It returns the deserialized result object returned by the remote endpoint or an error. If you do not set OS/Arch, CheckForUpdate will populate them for you. Similarly, if Version is 0, it will be set to 1. Lastly, if Checksum is the empty string, it will be automatically be computed for the running program's executable file.
type Result ¶
type Result struct { // should the update be applied automatically/manually Initiative Initiative `json:"initiative"` // url where to download the updated application Url string `json:"url"` // a URL to a patch to apply PatchUrl string `json:"patch_url"` // the patch format (only bsdiff supported at the moment) PatchType update.PatchType `json:"patch_type"` // version of the new application Version string `json:"version"` // expected checksum of the new application Checksum string `json:"checksum"` // signature for verifying update authenticity Signature string `json:"signature"` // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.