install

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: EPL-2.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateControllerDatabase added in v1.2.0

func CreateControllerDatabase(host, user, password, provider, dbName string, port int)

func GetLocalContainerName

func GetLocalContainerName(t string, isSystem bool) string

func IsVerbose

func IsVerbose() bool

func SetVerbosity

func SetVerbosity(verbose bool)

func Verbose

func Verbose(msg string)

func WaitForControllerAPI

func WaitForControllerAPI(endpoint string) (err error)

Types

type Agent

type Agent interface {
	Bootstrap() error
	// contains filtered or unexported methods
}

type AgentProcedures

type AgentProcedures struct {
	Deps      Entrypoint `yaml:"deps,omitempty"`
	Install   Entrypoint `yaml:"install,omitempty"`
	Uninstall Entrypoint `yaml:"uninstall,omitempty"`
	// contains filtered or unexported fields
}

type Auth added in v1.2.0

type Auth struct {
	URL              string
	Realm            string
	SSL              string
	RealmKey         string
	ControllerClient string
	ControllerSecret string
	ViewerClient     string
}

type Controller

type Controller struct {
	*ControllerOptions
	// contains filtered or unexported fields
}

func NewController

func NewController(options *ControllerOptions) (*Controller, error)

func (*Controller) CopyScript

func (ctrl *Controller) CopyScript(srcDir, filename, destDir string) (err error)

func (*Controller) Install

func (ctrl *Controller) Install() (err error)

func (*Controller) SetControllerExternalDatabase

func (ctrl *Controller) SetControllerExternalDatabase(host, user, password, provider, databaseName string, port int)

func (*Controller) Stop

func (ctrl *Controller) Stop() (err error)

func (*Controller) Uninstall

func (ctrl *Controller) Uninstall() (err error)

type ControllerConfig

type ControllerConfig struct {
	User          IofogUser
	Replicas      int32
	Database      Database
	PidBaseDir    string
	EcnViewerPort int
	Auth          Auth
}

type ControllerOptions

type ControllerOptions struct {
	User                string
	Host                string
	Port                int
	PrivKeyFilename     string
	Version             string
	Repo                string
	Token               string
	SystemMicroservices RemoteSystemMicroservices
	PidBaseDir          string
	EcnViewerPort       int
}

type Credentials

type Credentials struct {
	User     string
	Password string
}

type Database

type Database struct {
	Provider     string
	Host         string
	Port         int
	User         string
	Password     string
	DatabaseName string
}

type Entrypoint

type Entrypoint struct {
	Name string   `yaml:"entrypoint"`
	Args []string `yaml:"args"`
	// contains filtered or unexported fields
}

type ExecResult

type ExecResult struct {
	StdOut   string
	StdErr   string
	ExitCode int
}

ExecResult contains the output of a command ran into docker exec

type IofogUser

type IofogUser struct {
	Name            string
	Surname         string
	Email           string
	Password        string
	SubscriptionKey string
}

type Kubernetes

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

Kubernetes struct to manage state of deployment on Kubernetes cluster

func NewKubernetes

func NewKubernetes(configFilename, namespace string) (*Kubernetes, error)

NewKubernetes constructs an object to manage cluster

func (*Kubernetes) CreateControlPlane

func (k8s *Kubernetes) CreateControlPlane(conf *ControllerConfig) (endpoint string, err error)

CreateController on cluster

func (*Kubernetes) DeleteControlPlane

func (k8s *Kubernetes) DeleteControlPlane() error

func (*Kubernetes) ExistsInNamespace

func (k8s *Kubernetes) ExistsInNamespace(namespace string) error

func (*Kubernetes) GetControllerEndpoint

func (k8s *Kubernetes) GetControllerEndpoint() (endpoint string, err error)

func (*Kubernetes) GetControllerPods

func (k8s *Kubernetes) GetControllerPods() (podNames []Pod, err error)

func (*Kubernetes) SetControllerImage

func (k8s *Kubernetes) SetControllerImage(image string)

func (*Kubernetes) SetControllerService

func (k8s *Kubernetes) SetControllerService(svcType, ip string)

func (*Kubernetes) SetOperatorImage

func (k8s *Kubernetes) SetOperatorImage(image string)

func (*Kubernetes) SetPortManagerImage

func (k8s *Kubernetes) SetPortManagerImage(image string)

func (*Kubernetes) SetProxyImage

func (k8s *Kubernetes) SetProxyImage(image string)

func (*Kubernetes) SetProxyService

func (k8s *Kubernetes) SetProxyService(svcType, ip string)

func (*Kubernetes) SetRouterImage

func (k8s *Kubernetes) SetRouterImage(image string)

func (*Kubernetes) SetRouterService

func (k8s *Kubernetes) SetRouterService(svcType, ip string)

type LocalAgent

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

LocalAgent uses Container exec commands

func NewLocalAgent

func NewLocalAgent(localAgentConfig *LocalAgentConfig, client *LocalContainer) *LocalAgent

func (*LocalAgent) Bootstrap

func (agent *LocalAgent) Bootstrap() error

func (*LocalAgent) Configure

func (agent *LocalAgent) Configure(controllerEndpoint string, user IofogUser) (string, error)

type LocalAgentConfig

type LocalAgentConfig struct {
	LocalContainerConfig
	Name string
}

func NewLocalAgentConfig

func NewLocalAgentConfig(name, image string, ctrlConfig *LocalContainerConfig, credentials Credentials, isSystem bool) *LocalAgentConfig

NewAgentConfig generates a static agent config

type LocalContainer

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

LocalContainer struct to encapsulate utilities around docker

func NewLocalContainerClient

func NewLocalContainerClient() (*LocalContainer, error)

NewLocalContainerClient returns a LocalContainer struct

func (*LocalContainer) CleanContainer

func (lc *LocalContainer) CleanContainer(name string) error

CleanContainer stops and remove a container based on a container name

func (*LocalContainer) CleanContainerByID

func (lc *LocalContainer) CleanContainerByID(id string) error

func (*LocalContainer) CopyToContainer

func (lc *LocalContainer) CopyToContainer(name, source, dest string) (err error)

func (*LocalContainer) DeployContainer

func (lc *LocalContainer) DeployContainer(containerConfig *LocalContainerConfig) (string, error)

DeployContainer deploys a container based on an image and a port mappin

func (*LocalContainer) ExecuteCmd

func (lc *LocalContainer) ExecuteCmd(name string, cmd []string) (execResult ExecResult, err error)

func (*LocalContainer) GetContainerByName

func (lc *LocalContainer) GetContainerByName(name string) (types.Container, error)

func (*LocalContainer) GetContainerIP

func (lc *LocalContainer) GetContainerIP(name string) (ip string, err error)

func (*LocalContainer) GetLocalControllerEndpoint

func (lc *LocalContainer) GetLocalControllerEndpoint() (controllerEndpoint string, err error)

Returns endpoint to reach controller container from within another container

func (*LocalContainer) GetLogsByName

func (lc *LocalContainer) GetLogsByName(name string) (stdout, stderr string, err error)

GetLogsByName returns the logs of the container specified by name

func (*LocalContainer) ListContainers

func (lc *LocalContainer) ListContainers() ([]types.Container, error)

func (*LocalContainer) WaitForCommand

func (lc *LocalContainer) WaitForCommand(containerName string, condition *regexp.Regexp, command ...string) error

type LocalContainerConfig

type LocalContainerConfig struct {
	Host          string
	Ports         []port
	ContainerName string
	Image         string
	DefaultImage  string
	Privileged    bool
	Binds         []string
	NetworkMode   string
	Credentials   Credentials
}

func NewLocalControllerConfig

func NewLocalControllerConfig(image string, credentials Credentials) *LocalContainerConfig

NewLocalControllerConfig generats a static controller config

type LocalContainerPort

type LocalContainerPort struct {
	Protocol string
	Port     string
}

type LocalControllerConfig

type LocalControllerConfig struct {
	ContainerMap map[string]*LocalContainerConfig
}

type Pod

type Pod struct {
	Name   string
	Status string
}

type RemoteAgent

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

Remote agent uses SSH

func NewRemoteAgent

func NewRemoteAgent(user, host string, port int, privKeyFilename, agentName, agentUUID string) (*RemoteAgent, error)

func (*RemoteAgent) Bootstrap

func (agent *RemoteAgent) Bootstrap() error

func (*RemoteAgent) Configure

func (agent *RemoteAgent) Configure(controllerEndpoint string, user IofogUser) (string, error)

func (*RemoteAgent) CustomizeProcedures

func (agent *RemoteAgent) CustomizeProcedures(dir string, procs *AgentProcedures) error

func (*RemoteAgent) Deprovision

func (agent *RemoteAgent) Deprovision() (err error)

func (*RemoteAgent) Prune

func (agent *RemoteAgent) Prune() (err error)

func (*RemoteAgent) SetRepository

func (agent *RemoteAgent) SetRepository(repo, token string)

func (*RemoteAgent) SetVersion

func (agent *RemoteAgent) SetVersion(version string)

func (*RemoteAgent) Stop

func (agent *RemoteAgent) Stop() (err error)

func (*RemoteAgent) Uninstall

func (agent *RemoteAgent) Uninstall() (err error)

type RemoteSystemImages

type RemoteSystemImages struct {
	ARM string `yaml:"arm,omitempty"`
	X86 string `yaml:"x86,omitempty"`
}

type RemoteSystemMicroservices

type RemoteSystemMicroservices struct {
	Router RemoteSystemImages `yaml:"router,omitempty"`
	Proxy  RemoteSystemImages `yaml:"proxy,omitempty"`
}

Jump to

Keyboard shortcuts

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