common

package
v0.0.0-...-7396d26 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2024 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckForNewVersion

func CheckForNewVersion(localVersion, remoteVersion string) string

func CheckVersionPeriodically

func CheckVersionPeriodically(c *Config) (string, error)

func DockerInit

func DockerInit(cc *ContainerEngineConfig)

func NewDockerConfig

func NewDockerConfig(cc *ContainerEngineConfig) *docker.Config

NewDockerConfig creates and returns a new Docker client configuration

func ReadUserInput

func ReadUserInput(prompt string) string

ReadUserInput reads a string input from the user with a prompt.

Types

type AdminConfig

type AdminConfig struct {
	Path string `yaml:"path"`
}

type ArchVersion

type ArchVersion struct {
	Name string `json:"name"`
}

type BuildConfig

type BuildConfig struct {
	RunEnv       string `yaml:"-"` // come from env
	BuildVersion string `yaml:"-"` // come from build ldflags
	BuildCommit  string `yaml:"-"` // come from build ldflags
	BuildDate    string `yaml:"-"` // come from build ldflags
	ProxyURL     string `yaml:"-"`
}

func (*BuildConfig) GetRunEnv

func (config *BuildConfig) GetRunEnv() string

GetRunEnv returns the run environment

type Config

type Config struct {
	General         GeneralConfig         `yaml:"General"`
	Http            HttpConfig            `yaml:"Http"`
	Admin           AdminConfig           `yaml:"Admin"`
	ContainerEngine ContainerEngineConfig `yaml:"ContainerEngine"`
	Build           BuildConfig           `yaml:"-"`
}

func (*Config) GetStorageDir

func (config *Config) GetStorageDir() string

get storage dir

func (*Config) GetToken

func (config *Config) GetToken() (string, error)

func (*Config) GetVersion

func (config *Config) GetVersion() string

GetVersion returns the version

func (*Config) LoadConfig

func (config *Config) LoadConfig() (*Config, error)

func (*Config) SaveConfig

func (config *Config) SaveConfig() error

type ContainerEngineConfig

type ContainerEngineConfig struct {
	Sock       string `yaml:"dockersock"`
	PodmanSock string `yaml:"podmansock"`
	Podman     bool   `yaml:"podman"`
	Network    string `yaml:"network"`
}

type CurrentVersion

type CurrentVersion struct {
	Version string `json:"version"`
	// contains filtered or unexported fields
}

func GetCurrentBuildVersionInfo

func GetCurrentBuildVersionInfo(c *Config) CurrentVersion

type DeployPayload

type DeployPayload struct {
	Ports        string `json:"ports"`
	TargetDomain string `json:"targetdomain"`
	ImageName    string `json:"imagename"`
	ImageID      string `json:"imageid"`
	Data         io.ReadCloser
}

func (DeployPayload) GetType

func (p DeployPayload) GetType() string

type GeneralConfig

type GeneralConfig struct {
	StorageDir string `yaml:"storageDir"`
	Token      string `yaml:"token"`
}

type HttpConfig

type HttpConfig struct {
	Port       string `yaml:"port"`
	Domain     string `yaml:"domain"`
	SubDomain  string `yaml:"subDomain"`
	BackendURL string `yaml:"backendURL"`
	Https      bool   `yaml:"https"`
}

type Payload

type Payload interface {
	GetType() string
}

type PingPayload

type PingPayload struct {
	Message string `json:"message"`
}

func NewPingPayload

func NewPingPayload(data map[string]interface{}) (PingPayload, error)

func (PingPayload) GetType

func (p PingPayload) GetType() string

type RequestPayload

type RequestPayload struct {
	Type    string  `json:"type"`
	Payload Payload `json:"payload"`
}

func (*RequestPayload) UnmarshalJSON

func (p *RequestPayload) UnmarshalJSON(data []byte) error

type VersionInfo

type VersionInfo struct {
	Name string `json:"name"`
}

type VersionsResponse

type VersionsResponse struct {
	Name  string      `json:"name"`
	AMD64 VersionInfo `json:"amd64"`
	ARM64 VersionInfo `json:"arm64"`
}

Jump to

Keyboard shortcuts

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