common

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: AGPL-3.0 Imports: 10 Imported by: 0 modules, 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

View Source
const REGISTER_API = "/instance/_register"
View Source
const SYNC_API = "/configs/_sync"

Variables

This section is empty.

Functions

func GenerateClientCert

func GenerateClientCert(caFile, caKey string) (caCert, clientCertPEM, clientKeyPEM []byte, err error)

func GenerateServerCert

func GenerateServerCert(caFile, caKey string) (caCert, serverCertPEM, serverKeyPEM []byte, err error)

func GetAgentInstanceCerts

func GetAgentInstanceCerts(caFile, caKey string) (string, string, error)

func GetOrInitDefaultCaCerts

func GetOrInitDefaultCaCerts() (string, string, error)

Types

type AgentConfig

type AgentConfig struct {
	Enabled bool         `config:"enabled"`
	Setup   *SetupConfig `config:"setup"`
}

func GetAgentConfig

func GetAgentConfig() *AgentConfig

type ConfigDeleteRequest

type ConfigDeleteRequest struct {
	Configs []string `json:"configs"`
}

type ConfigFile

type ConfigFile struct {
	Name     string `json:"name,omitempty"`
	Location string `json:"location,omitempty"`
	Content  string `json:"content,omitempty"`
	Updated  int64  `json:"updated,omitempty"`
	Version  int64  `json:"version,omitempty"`
	Size     int64  `json:"size,omitempty"`
	Readonly bool   `json:"readonly,omitempty"`
	Managed  bool   `json:"managed"`
	Hash     string `json:"hash,omitempty"`
}

type ConfigGroup

type ConfigGroup struct {
	Files []string `config:"files"`
}

type ConfigList

type ConfigList struct {
	Main    ConfigFile            `json:"main,omitempty"`
	Configs map[string]ConfigFile `json:"configs,omitempty"`
}

type ConfigRepo

type ConfigRepo struct {
	ConfigGroups   map[string]ConfigGroup   `config:"configs"`
	InstanceGroups map[string]InstanceGroup `config:"instances"`
	SecretGroups   map[string]Secrets       `config:"secrets"`
}

type ConfigSyncRequest

type ConfigSyncRequest struct {
	ForceSync bool           `json:"force_sync"` //ignore hash check in server
	Hash      string         `json:"hash"`
	Client    model.Instance `json:"client"`
	Configs   ConfigList     `json:"configs"`
}

type ConfigSyncResponse

type ConfigSyncResponse struct {
	Changed bool `json:"changed"`
	Configs struct {
		CreatedConfigs map[string]ConfigFile `json:"created,omitempty"`
		DeletedConfigs map[string]ConfigFile `json:"deleted,omitempty"`
		UpdatedConfigs map[string]ConfigFile `json:"updated,omitempty"`
	} `json:"configs,omitempty"`

	Secrets *Secrets `json:"secrets,omitempty"`
}

type ConfigUpdateRequest

type ConfigUpdateRequest struct {
	Configs map[string]string `json:"configs"`
}

type InstanceGroup

type InstanceGroup struct {
	ConfigGroups []string `config:"configs"`
	Instances    []string `config:"instances"`
	Secrets      []string `config:"secrets"`
}

type InstanceSettings

type InstanceSettings struct {
	ConfigFiles []string `config:"configs"`
	Secrets     []string `config:"secrets"`
}

type KeystoreValue

type KeystoreValue struct {
	Type  string `json:"type"`
	Value string `json:"value"`
}

type ResourceGroup

type ResourceGroup struct {
	Name string   `json:"name"`
	List []string `json:"list"`
}

type Secrets

type Secrets struct {
	Keystore map[string]KeystoreValue `json:"keystore,omitempty"`
}

type SetupConfig

type SetupConfig struct {
	DownloadURL     string `config:"download_url"`
	CACertFile      string `config:"ca_cert"`
	CAKeyFile       string `config:"ca_key"`
	ConsoleEndpoint string `config:"console_endpoint"`
	Port            string `config:"port"`
}

Jump to

Keyboard shortcuts

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