engine

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2021 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const CURRENT_APP = "currentApp"
View Source
const INSTANCE_ID_KEY = "instanceID"
View Source
const (
	NORMAL_EXIT = 0
)

Variables

This section is empty.

Functions

func DownloadFile added in v0.0.2

func DownloadFile(filepath string, url string) error

func FetchRelease added in v0.0.2

func FetchRelease(myTag string) (string, error)

func GetCacheDir added in v0.0.2

func GetCacheDir() string

func GetLatestApplication added in v0.0.2

func GetLatestApplication(ctx *FetcherContext) (string, error)

func GetUpdaterDir added in v0.0.2

func GetUpdaterDir() string

func GetWorkDir added in v0.0.2

func GetWorkDir() string

func SetLatestApplication added in v0.0.2

func SetLatestApplication(ctx *FetcherContext, path string) error

func SetWorkDir added in v0.0.2

func SetWorkDir(wd string)

func TestUpload added in v0.0.2

func TestUpload(personalAccessToken string)

Types

type Asset

type Asset struct {
	Name string
	Url  string
}

type FetcherContext added in v0.0.2

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

func InitFetcher added in v0.0.2

func InitFetcher(storagePath string) FetcherContext

type InstanceID added in v0.0.2

type InstanceID struct {
	Id    string `json:"id"`
	Cloud string `json:"cloud"`
	Addr  string `json:"addr"`
}

func GetInstanceID added in v0.0.2

func GetInstanceID() *InstanceID

type InstanceInfo added in v0.0.2

type InstanceInfo struct {
	Version  string       `json:"version"`
	Instance InstanceID   `json:"instance"`
	Stat     MachineStats `json:"stat"`
}

func Fetch added in v0.0.2

func Fetch(ctx *FetcherContext) (*InstanceInfo, error)

type MachineStats added in v0.0.2

type MachineStats struct {
	TotalMemory  uint64  `json:"totalMemory"`
	UsedMemory   uint64  `json:"usedMemory"`
	CpuLoad      float32 `json:"cpuLoad"`
	BytesSent    uint64  `json:"bytesSent"`
	ByteReceived uint64  `json:"byteReceived"`
}

func GetMachineStats added in v0.0.2

func GetMachineStats() (*MachineStats, error)

type Release

type Release struct {
	Tag         string
	Description string
	Assets      []Asset
}

func ListReleases

func ListReleases() ([]Release, error)

type TokenSource added in v0.0.2

type TokenSource struct {
	AccessToken string
}

----------------------------------------------------------------------------------

func (*TokenSource) Token added in v0.0.2

func (t *TokenSource) Token() (*oauth2.Token, error)

Jump to

Keyboard shortcuts

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