{"modulePath":"github.com/utmstack/UTMStack/installer","version":"v0.0.0-20261203180808-4d12b9be42b1","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package updater\n\n## Functions\n\n```go\nfunc ClearPendingUpdate() error\n```\n\n```go\nfunc CompareVersions(v1, v2 Version) int\n```\n\n```go\nfunc ExtractVersionFromFolder(folder string) (string, error)\n```\n\n```go\nfunc GetConfigServ() *service.Config\n```\n\n```go\nfunc InstallService()\n```\n\n```go\nfunc MonitorConnection(server string, timeSleep time.Duration, maxAttempts int, hasConnection *bool)\n```\n\n```go\nfunc PollAndUpdateAdminEmail(instanceConf InstanceConfig)\n```\nPollAndUpdateAdminEmail polls for admin email and updates instance details\n\n```go\nfunc RegisterInstance() error\n```\n\n```go\nfunc RunService()\n```\n\n```go\nfunc SavePendingUpdate(update PendingUpdate) error\n```\n\n```go\nfunc SaveVersion(vers, edition, changelog string) error\n```\n\n```go\nfunc SortVersions(versions []map[string]string) []map[string]string\n```\n\n```go\nfunc StartHeartbeat(instanceConf InstanceConfig)\n```\nStartHeartbeat sends heartbeat to CM every minute\n\n```go\nfunc StartUsageReporting(instanceConf InstanceConfig)\n```\n\n```go\nfunc UninstallService()\n```\n\n## Types\n\n```go\ntype Auth struct {\n\tID  string `json:\"id\"`\n\tKey string `json:\"key\"`\n}\n```\n\n```go\ntype InstanceConfig struct {\n\tServer      string `yaml:\"server\"`\n\tInstanceID  string `yaml:\"instance_id\"`\n\tInstanceKey string `yaml:\"instance_key\"`\n}\n```\n\n```go\ntype InstanceDTOInput struct {\n\tName        string `json:\"name\"`\n\tCountry     string `json:\"country\"`\n\tEmail       string `json:\"email\"`\n\tVersion     string `json:\"version\"`\n\tEdition     string `json:\"edition\"`\n\tCurrentIp   string `json:\"current_ip\"`\n\tMappingName string `json:\"mapping_name,omitempty\"`\n\tTags        string `json:\"tags\"`\n\tProductSlug string `json:\"product_slug,omitempty\"`\n}\n```\n\n```go\ntype InstanceDTOOutput struct {\n\tID string `json:\"id\"`\n\tInstanceDTOInput\n\tCreatedAt string `json:\"created_at\"`\n}\n```\n\n```go\ntype InstanceInfo struct {\n\tName       string `json:\"name\"`\n\tCountry    string `json:\"country\"`\n\tEmail      string `json:\"email\"`\n\tVersion    string `json:\"version\"`\n\tInstanceID string `json:\"instance_id\"`\n}\n```\n\n```go\ntype LicenseEncrypted struct {\n\tExpiresAt   time.Time `json:\"expires_at\"`\n\tDatasources int64     `json:\"datasources\"`\n\tCPU         int64     `json:\"cpu\"`\n\tMemory      int64     `json:\"memory\"`\n\tType        string    `json:\"type\"`\n\tCreatedAt   string    `json:\"created_at\"`\n}\n```\n\n```go\ntype PendingUpdate struct {\n\tID          string `json:\"id\"`\n\tVersion     string `json:\"version\"`\n\tEdition     string `json:\"edition\"`\n\tChangelog   string `json:\"changelog\"`\n\tUpdateLocks string `json:\"update_locks\"`\n}\n```\n\n```go\nfunc GetPendingUpdate() (*PendingUpdate, error)\n```\n\n```go\ntype UpdateDTO struct {\n\tID          string           `json:\"id\"`\n\tInstance    InstanceDTOInput `json:\"instance,omitempty\"`\n\tVersion     VersionDTO       `json:\"version\"`\n\tEdition     string           `json:\"edition\"`\n\tSent        bool             `json:\"sent\"`\n\tApproved    bool             `json:\"approved\"`\n\tApproveAt   time.Time        `json:\"aprove_at,omitempty\"`\n\tUpdateLocks string           `json:\"update_locks,omitempty\"`\n}\n```\n\n```go\ntype UpdaterClient struct {\n\tConfig  InstanceConfig\n\tLicense string\n}\n```\n\n```go\nfunc GetUpdaterClient() *UpdaterClient\n```\n\n```go\nfunc (c *UpdaterClient) CheckLicense() error\n```\n\n```go\nfunc (c *UpdaterClient) CheckUpdate() error\n```\n\n```go\nfunc (c *UpdaterClient) LicenseProcess()\n```\n\n```go\nfunc (c *UpdaterClient) MarkUpdateSent(updateId string) error\n```\n\n```go\nfunc (c *UpdaterClient) UpdateInstaller(version string) error\n```\n\n```go\nfunc (c *UpdaterClient) UpdateProcess()\n```\n\n```go\ntype Version struct {\n\tMajor          int\n\tMinor          int\n\tPatch          int\n\tPrereleaseName string // alpha, beta, rc, or empty\n\tPrereleaseNum  int    // the number after alpha.X, beta.X, rc.X\n\tOriginal       string\n}\n```\nVersion sorting functions\n\n```go\nfunc ParseVersion(versionStr string) Version\n```\n\n```go\ntype VersionDTO struct {\n\tVersion   string `json:\"version\"`\n\tChangelog string `json:\"changelog\"`\n}\n```\n\n```go\ntype VersionFile struct {\n\tVersion   string `json:\"version\"`\n\tChangelog string `json:\"changelog\"`\n\tEdition   string `json:\"edition\"`\n}\n```\n\n```go\nfunc GetVersion() (VersionFile, error)\n```\n\n","path":"github.com/utmstack/UTMStack/installer/updater","name":"updater","synopsis":"","isRedistributable":true}
