updater

package
v0.0.0-...-4d12b9b Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2026 License: AGPL-3.0 Imports: 19 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearPendingUpdate

func ClearPendingUpdate() error

func CompareVersions

func CompareVersions(v1, v2 Version) int

func ExtractVersionFromFolder

func ExtractVersionFromFolder(folder string) (string, error)

func GetConfigServ

func GetConfigServ() *service.Config

func InstallService

func InstallService()

func MonitorConnection

func MonitorConnection(server string, timeSleep time.Duration, maxAttempts int, hasConnection *bool)

func PollAndUpdateAdminEmail

func PollAndUpdateAdminEmail(instanceConf InstanceConfig)

PollAndUpdateAdminEmail polls for admin email and updates instance details

func RegisterInstance

func RegisterInstance() error

func RunService

func RunService()

func SavePendingUpdate

func SavePendingUpdate(update PendingUpdate) error

func SaveVersion

func SaveVersion(vers, edition, changelog string) error

func SortVersions

func SortVersions(versions []map[string]string) []map[string]string

func StartHeartbeat

func StartHeartbeat(instanceConf InstanceConfig)

StartHeartbeat sends heartbeat to CM every minute

func StartUsageReporting

func StartUsageReporting(instanceConf InstanceConfig)

func UninstallService

func UninstallService()

Types

type Auth

type Auth struct {
	ID  string `json:"id"`
	Key string `json:"key"`
}

type InstanceConfig

type InstanceConfig struct {
	Server      string `yaml:"server"`
	InstanceID  string `yaml:"instance_id"`
	InstanceKey string `yaml:"instance_key"`
}

type InstanceDTOInput

type InstanceDTOInput struct {
	Name        string `json:"name"`
	Country     string `json:"country"`
	Email       string `json:"email"`
	Version     string `json:"version"`
	Edition     string `json:"edition"`
	CurrentIp   string `json:"current_ip"`
	MappingName string `json:"mapping_name,omitempty"`
	Tags        string `json:"tags"`
	ProductSlug string `json:"product_slug,omitempty"`
}

type InstanceDTOOutput

type InstanceDTOOutput struct {
	ID string `json:"id"`
	InstanceDTOInput
	CreatedAt string `json:"created_at"`
}

type InstanceInfo

type InstanceInfo struct {
	Name       string `json:"name"`
	Country    string `json:"country"`
	Email      string `json:"email"`
	Version    string `json:"version"`
	InstanceID string `json:"instance_id"`
}

type LicenseEncrypted

type LicenseEncrypted struct {
	ExpiresAt   time.Time `json:"expires_at"`
	Datasources int64     `json:"datasources"`
	CPU         int64     `json:"cpu"`
	Memory      int64     `json:"memory"`
	Type        string    `json:"type"`
	CreatedAt   string    `json:"created_at"`
}

type PendingUpdate

type PendingUpdate struct {
	ID          string `json:"id"`
	Version     string `json:"version"`
	Edition     string `json:"edition"`
	Changelog   string `json:"changelog"`
	UpdateLocks string `json:"update_locks"`
}

func GetPendingUpdate

func GetPendingUpdate() (*PendingUpdate, error)

type UpdateDTO

type UpdateDTO struct {
	ID          string           `json:"id"`
	Instance    InstanceDTOInput `json:"instance,omitempty"`
	Version     VersionDTO       `json:"version"`
	Edition     string           `json:"edition"`
	Sent        bool             `json:"sent"`
	Approved    bool             `json:"approved"`
	ApproveAt   time.Time        `json:"aprove_at,omitempty"`
	UpdateLocks string           `json:"update_locks,omitempty"`
}

type UpdaterClient

type UpdaterClient struct {
	Config  InstanceConfig
	License string
}

func GetUpdaterClient

func GetUpdaterClient() *UpdaterClient

func (*UpdaterClient) CheckLicense

func (c *UpdaterClient) CheckLicense() error

func (*UpdaterClient) CheckUpdate

func (c *UpdaterClient) CheckUpdate() error

func (*UpdaterClient) LicenseProcess

func (c *UpdaterClient) LicenseProcess()

func (*UpdaterClient) MarkUpdateSent

func (c *UpdaterClient) MarkUpdateSent(updateId string) error

func (*UpdaterClient) UpdateInstaller

func (c *UpdaterClient) UpdateInstaller(version string) error

func (*UpdaterClient) UpdateProcess

func (c *UpdaterClient) UpdateProcess()

type Version

type Version struct {
	Major          int
	Minor          int
	Patch          int
	PrereleaseName string // alpha, beta, rc, or empty
	PrereleaseNum  int    // the number after alpha.X, beta.X, rc.X
	Original       string
}

Version sorting functions

func ParseVersion

func ParseVersion(versionStr string) Version

type VersionDTO

type VersionDTO struct {
	Version   string `json:"version"`
	Changelog string `json:"changelog"`
}

type VersionFile

type VersionFile struct {
	Version   string `json:"version"`
	Changelog string `json:"changelog"`
	Edition   string `json:"edition"`
}

func GetVersion

func GetVersion() (VersionFile, error)

Jump to

Keyboard shortcuts

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