instance

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2018 License: AGPL-3.0 Imports: 14 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDuplicateInstance = errors.New("duplicate instance")
	ErrCmdNotSupport     = errors.New("command not supported")
	ErrNoLink            = errors.New("no instances link from API")
)

Functions

func GetMySQLInfo

func GetMySQLInfo(in *proto.Instance) error

Types

type ByUUID

type ByUUID []proto.Instance

func (ByUUID) Len

func (s ByUUID) Len() int

func (ByUUID) Less

func (s ByUUID) Less(i, j int) bool

func (ByUUID) Swap

func (s ByUUID) Swap(i, j int)

type ErrInstanceNotFound

type ErrInstanceNotFound string

func (ErrInstanceNotFound) Error added in v1.5.0

func (e ErrInstanceNotFound) Error() string

type Manager

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

func NewManager

func NewManager(logger *pct.Logger, instanceDir string, api pct.APIConnector, monitor mrms.Monitor) *Manager

func (*Manager) GetConfig

func (m *Manager) GetConfig() ([]proto.AgentConfig, []error)

func (*Manager) GetDefaults

func (m *Manager) GetDefaults(uuid string) map[string]interface{}

func (*Manager) Handle

func (m *Manager) Handle(cmd *proto.Cmd) *proto.Reply

func (*Manager) Repo

func (m *Manager) Repo() *Repo

func (*Manager) Start

func (m *Manager) Start() error

func (*Manager) Status

func (m *Manager) Status() map[string]string

func (*Manager) Stop

func (m *Manager) Stop() error

type Repo

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

func NewRepo

func NewRepo(logger *pct.Logger, instanceDir string, api pct.APIConnector) *Repo

Creates a new instance repository and returns a pointer to it

func (*Repo) Add

func (r *Repo) Add(in proto.Instance, writeToDisk bool) error

func (*Repo) Get

func (r *Repo) Get(uuid string, cache bool) (proto.Instance, error)

func (*Repo) Init

func (r *Repo) Init() (err error)

Initializes the instance repository by reading system tree from local file

func (*Repo) List

func (r *Repo) List(subsystemName string) []proto.Instance

func (*Repo) Remove

func (r *Repo) Remove(uuid string) error

func (*Repo) Update added in v1.5.0

func (r *Repo) Update(in proto.Instance, writeToDisk bool) error

Update updates an existing instance in the repo and optionally writes its config to into a json config file

Jump to

Keyboard shortcuts

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