Documentation ¶
Index ¶
- func GetLocalContainerName(t string, isSystem bool) string
- func IsVerbose() bool
- func SetVerbosity(verbose bool)
- func Verbose(msg string)
- func WaitForControllerAPI(endpoint string) (err error)
- type Agent
- type AgentProcedures
- type Controller
- func (ctrl *Controller) CopyScript(srcDir, filename, destDir string) (err error)
- func (ctrl *Controller) Install() (err error)
- func (ctrl *Controller) SetControllerExternalDatabase(host, user, password, provider, databaseName string, port int)
- func (ctrl *Controller) Stop() (err error)
- func (ctrl *Controller) Uninstall() (err error)
- type ControllerConfig
- type ControllerOptions
- type Credentials
- type Database
- type Entrypoint
- type ExecResult
- type IofogUser
- type Kubernetes
- func (k8s *Kubernetes) CreateControlPlane(conf *ControllerConfig) (endpoint string, err error)
- func (k8s *Kubernetes) DeleteControlPlane() error
- func (k8s *Kubernetes) ExistsInNamespace(namespace string) error
- func (k8s *Kubernetes) GetControllerEndpoint() (endpoint string, err error)
- func (k8s *Kubernetes) GetControllerPods() (podNames []Pod, err error)
- func (k8s *Kubernetes) SetControllerImage(image string)
- func (k8s *Kubernetes) SetControllerService(svcType, ip string)
- func (k8s *Kubernetes) SetOperatorImage(image string)
- func (k8s *Kubernetes) SetPortManagerImage(image string)
- func (k8s *Kubernetes) SetProxyImage(image string)
- func (k8s *Kubernetes) SetProxyService(svcType, ip string)
- func (k8s *Kubernetes) SetRouterImage(image string)
- func (k8s *Kubernetes) SetRouterService(svcType, ip string)
- type LocalAgent
- type LocalAgentConfig
- type LocalContainer
- func (lc *LocalContainer) CleanContainer(name string) error
- func (lc *LocalContainer) CleanContainerByID(id string) error
- func (lc *LocalContainer) CopyToContainer(name, source, dest string) (err error)
- func (lc *LocalContainer) DeployContainer(containerConfig *LocalContainerConfig) (string, error)
- func (lc *LocalContainer) ExecuteCmd(name string, cmd []string) (execResult ExecResult, err error)
- func (lc *LocalContainer) GetContainerByName(name string) (types.Container, error)
- func (lc *LocalContainer) GetContainerIP(name string) (ip string, err error)
- func (lc *LocalContainer) GetLocalControllerEndpoint() (controllerEndpoint string, err error)
- func (lc *LocalContainer) GetLogsByName(name string) (stdout, stderr string, err error)
- func (lc *LocalContainer) ListContainers() ([]types.Container, error)
- func (lc *LocalContainer) WaitForCommand(containerName string, condition *regexp.Regexp, command ...string) error
- type LocalContainerConfig
- type LocalContainerPort
- type LocalControllerConfig
- type Pod
- type RemoteAgent
- func (agent *RemoteAgent) Bootstrap() error
- func (agent *RemoteAgent) Configure(controllerEndpoint string, user IofogUser) (string, error)
- func (agent *RemoteAgent) CustomizeProcedures(dir string, procs *AgentProcedures) error
- func (agent *RemoteAgent) Deprovision() (err error)
- func (agent *RemoteAgent) Prune() (err error)
- func (agent *RemoteAgent) SetRepository(repo, token string)
- func (agent *RemoteAgent) SetVersion(version string)
- func (agent *RemoteAgent) Stop() (err error)
- func (agent *RemoteAgent) Uninstall() (err error)
- type RemoteSystemImages
- type RemoteSystemMicroservices
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetLocalContainerName ¶
func SetVerbosity ¶
func SetVerbosity(verbose bool)
func WaitForControllerAPI ¶
Types ¶
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 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 ControllerOptions ¶
type Credentials ¶
type Entrypoint ¶
type ExecResult ¶
ExecResult contains the output of a command ran into docker exec
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
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 ¶
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 LocalControllerConfig ¶
type LocalControllerConfig struct {
ContainerMap map[string]*LocalContainerConfig
}
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 RemoteSystemMicroservices ¶
type RemoteSystemMicroservices struct { Router RemoteSystemImages `yaml:"router,omitempty"` Proxy RemoteSystemImages `yaml:"proxy,omitempty"` }