Documentation
¶
Overview ¶
Package core is a generated GoMock package.
Index ¶
- Constants
- Variables
- func CheckHomeConfigIsEmpty(configPath string) error
- func GenerateHookScripts(options *GlobalOptions, svcPath string, elcBinary string, scriptsFolder string) error
- func SaveHomeConfig(homeConfig *HomeConfig) error
- type Component
- func (comp *Component) Clone(options *GlobalOptions, noHook bool) error
- func (comp *Component) Compose(params *GlobalOptions) (int, error)
- func (comp *Component) Destroy(options *GlobalOptions) error
- func (comp *Component) DumpVars() error
- func (comp *Component) Exec(options *GlobalOptions) (int, error)
- func (comp *Component) IsCloned() (bool, error)
- func (comp *Component) IsRunning(options *GlobalOptions) (bool, error)
- func (comp *Component) Restart(hard bool, options *GlobalOptions) error
- func (comp *Component) Run(options *GlobalOptions) (int, error)
- func (comp *Component) Start(options *GlobalOptions) error
- func (comp *Component) Stop(options *GlobalOptions) error
- func (comp *Component) UpdateHooks(options *GlobalOptions, elcBinary string, scriptsFolder string) error
- func (comp *Component) Wrap(command []string, options *GlobalOptions) (int, error)
- type ComponentConfig
- type Context
- type GlobalOptions
- type HomeConfig
- func (hc *HomeConfig) AddWorkspace(name string, path string) error
- func (hc *HomeConfig) FindWorkspace(name string) *HomeConfigItem
- func (hc *HomeConfig) FindWorkspaceByPath() (*HomeConfigItem, error)
- func (hc *HomeConfig) GetCurrentWorkspace(wsName string) (*HomeConfigItem, error)
- func (hc *HomeConfig) GetCurrentWsPath(wsName string) (string, error)
- func (hc *HomeConfig) RemoveWorkspace(name string) error
- type HomeConfigItem
- type MockPC
- func (m *MockPC) Args() []string
- func (m *MockPC) Chmod(filename string, mode os.FileMode) error
- func (m *MockPC) CreateDir(path string) error
- func (m *MockPC) CreateFile(filename string) error
- func (m *MockPC) EXPECT() *MockPCMockRecorder
- func (m *MockPC) ExecInteractive(command, env []string) (int, error)
- func (m *MockPC) ExecToString(command, env []string) (int, string, error)
- func (m *MockPC) Exit(code int)
- func (m *MockPC) FileExists(filepath string) bool
- func (m *MockPC) Getuid() int
- func (m *MockPC) Getwd() (string, error)
- func (m *MockPC) HomeDir() (string, error)
- func (m *MockPC) IsTerminal() bool
- func (m *MockPC) Printf(format string, a ...interface{}) (int, error)
- func (m *MockPC) Println(a ...interface{}) (int, error)
- func (m *MockPC) ReadDir(dirname string) ([]os.FileInfo, error)
- func (m *MockPC) ReadFile(filename string) ([]byte, error)
- func (m *MockPC) WriteFile(filename string, data []byte, perm os.FileMode) error
- type MockPCMockRecorder
- func (mr *MockPCMockRecorder) Args() *gomock.Call
- func (mr *MockPCMockRecorder) Chmod(filename, mode interface{}) *gomock.Call
- func (mr *MockPCMockRecorder) CreateDir(path interface{}) *gomock.Call
- func (mr *MockPCMockRecorder) CreateFile(filename interface{}) *gomock.Call
- func (mr *MockPCMockRecorder) ExecInteractive(command, env interface{}) *gomock.Call
- func (mr *MockPCMockRecorder) ExecToString(command, env interface{}) *gomock.Call
- func (mr *MockPCMockRecorder) Exit(code interface{}) *gomock.Call
- func (mr *MockPCMockRecorder) FileExists(filepath interface{}) *gomock.Call
- func (mr *MockPCMockRecorder) Getuid() *gomock.Call
- func (mr *MockPCMockRecorder) Getwd() *gomock.Call
- func (mr *MockPCMockRecorder) HomeDir() *gomock.Call
- func (mr *MockPCMockRecorder) IsTerminal() *gomock.Call
- func (mr *MockPCMockRecorder) Printf(format interface{}, a ...interface{}) *gomock.Call
- func (mr *MockPCMockRecorder) Println(a ...interface{}) *gomock.Call
- func (mr *MockPCMockRecorder) ReadDir(dirname interface{}) *gomock.Call
- func (mr *MockPCMockRecorder) ReadFile(filename interface{}) *gomock.Call
- func (mr *MockPCMockRecorder) WriteFile(filename, data, perm interface{}) *gomock.Call
- type ModeList
- type PC
- type RealPC
- func (r *RealPC) Args() []string
- func (r *RealPC) Chmod(filename string, mode os.FileMode) error
- func (r *RealPC) CreateDir(path string) error
- func (r *RealPC) CreateFile(filename string) error
- func (r *RealPC) ExecInteractive(command []string, env []string) (int, error)
- func (r *RealPC) ExecToString(command []string, env []string) (int, string, error)
- func (r *RealPC) Exit(code int)
- func (r *RealPC) FileExists(filepath string) bool
- func (r *RealPC) Getuid() int
- func (r *RealPC) Getwd() (dir string, err error)
- func (r *RealPC) HomeDir() (string, error)
- func (r *RealPC) IsTerminal() bool
- func (r *RealPC) Printf(format string, a ...interface{}) (n int, err error)
- func (r *RealPC) Println(a ...interface{}) (n int, err error)
- func (r *RealPC) ReadDir(dirname string) ([]os.FileInfo, error)
- func (r *RealPC) ReadFile(filename string) ([]byte, error)
- func (r *RealPC) WriteFile(filename string, data []byte, perm os.FileMode) error
- type Workspace
- func (ws *Workspace) ComponentByName(name string) (*Component, error)
- func (ws *Workspace) ComponentByPath() (*Component, error)
- func (ws *Workspace) ComponentNameByPath() (string, error)
- func (ws *Workspace) FindComponentNamesByTag(tag string) []string
- func (ws *Workspace) GetComponentNames() []string
- func (ws *Workspace) GetComponentNamesList() []string
- func (ws *Workspace) LoadConfig() error
- type WorkspaceConfig
Constants ¶
const DefaultUpdateCommand = "curl -sSL https://raw.githubusercontent.com/ensi-platform/elc/master/get.sh | sudo -E bash"
Variables ¶
var Version string
Functions ¶
func CheckHomeConfigIsEmpty ¶
func GenerateHookScripts ¶
func GenerateHookScripts(options *GlobalOptions, svcPath string, elcBinary string, scriptsFolder string) error
func SaveHomeConfig ¶
func SaveHomeConfig(homeConfig *HomeConfig) error
Types ¶
type Component ¶
type Component struct { Name string Config *ComponentConfig Template *ComponentConfig JustStarted bool Context *Context Workspace *Workspace }
func NewComponent ¶
func NewComponent(compName string, compCfg *ComponentConfig, ws *Workspace) *Component
func (*Component) Destroy ¶
func (comp *Component) Destroy(options *GlobalOptions) error
func (*Component) IsRunning ¶
func (comp *Component) IsRunning(options *GlobalOptions) (bool, error)
func (*Component) Start ¶
func (comp *Component) Start(options *GlobalOptions) error
func (*Component) Stop ¶
func (comp *Component) Stop(options *GlobalOptions) error
func (*Component) UpdateHooks ¶
func (comp *Component) UpdateHooks(options *GlobalOptions, elcBinary string, scriptsFolder string) error
type ComponentConfig ¶
type ComponentConfig struct { Alias string `yaml:"alias"` ComposeFile string `yaml:"compose_file"` Dependencies map[string]ModeList `yaml:"dependencies"` ExecPath string `yaml:"exec_path"` Extends string `yaml:"extends"` HostedIn string `yaml:"hosted_in"` Hostname string `yaml:"hostname"` IsTemplate bool `yaml:"is_template"` Path string `yaml:"path"` Replace bool `yaml:"replace"` Variables yaml.MapSlice `yaml:"variables"` Repository string `yaml:"repository"` Tags []string `yaml:"tags"` AfterCloneHook string `yaml:"after_clone_hook"` }
func (*ComponentConfig) GetDeps ¶
func (cc *ComponentConfig) GetDeps(mode string) []string
type GlobalOptions ¶
type HomeConfig ¶
type HomeConfig struct { Path string `yaml:"-"` CurrentWorkspace string `yaml:"current_workspace"` UpdateCommand string `yaml:"update_command"` Workspaces []HomeConfigItem `yaml:"workspaces"` }
func CheckAndLoadHC ¶
func CheckAndLoadHC() (*HomeConfig, error)
func LoadHomeConfig ¶
func LoadHomeConfig(configPath string) (*HomeConfig, error)
func (*HomeConfig) AddWorkspace ¶
func (hc *HomeConfig) AddWorkspace(name string, path string) error
func (*HomeConfig) FindWorkspace ¶
func (hc *HomeConfig) FindWorkspace(name string) *HomeConfigItem
func (*HomeConfig) FindWorkspaceByPath ¶
func (hc *HomeConfig) FindWorkspaceByPath() (*HomeConfigItem, error)
func (*HomeConfig) GetCurrentWorkspace ¶
func (hc *HomeConfig) GetCurrentWorkspace(wsName string) (*HomeConfigItem, error)
func (*HomeConfig) GetCurrentWsPath ¶
func (hc *HomeConfig) GetCurrentWsPath(wsName string) (string, error)
func (*HomeConfig) RemoveWorkspace ¶
func (hc *HomeConfig) RemoveWorkspace(name string) error
type HomeConfigItem ¶
type MockPC ¶
type MockPC struct {
// contains filtered or unexported fields
}
MockPC is a mock of PC interface.
func NewMockPC ¶
func NewMockPC(ctrl *gomock.Controller) *MockPC
NewMockPC creates a new mock instance.
func (*MockPC) CreateFile ¶
CreateFile mocks base method.
func (*MockPC) EXPECT ¶
func (m *MockPC) EXPECT() *MockPCMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockPC) ExecInteractive ¶
ExecInteractive mocks base method.
func (*MockPC) ExecToString ¶
ExecToString mocks base method.
func (*MockPC) FileExists ¶
FileExists mocks base method.
type MockPCMockRecorder ¶
type MockPCMockRecorder struct {
// contains filtered or unexported fields
}
MockPCMockRecorder is the mock recorder for MockPC.
func (*MockPCMockRecorder) Args ¶
func (mr *MockPCMockRecorder) Args() *gomock.Call
Args indicates an expected call of Args.
func (*MockPCMockRecorder) Chmod ¶
func (mr *MockPCMockRecorder) Chmod(filename, mode interface{}) *gomock.Call
Chmod indicates an expected call of Chmod.
func (*MockPCMockRecorder) CreateDir ¶
func (mr *MockPCMockRecorder) CreateDir(path interface{}) *gomock.Call
CreateDir indicates an expected call of CreateDir.
func (*MockPCMockRecorder) CreateFile ¶
func (mr *MockPCMockRecorder) CreateFile(filename interface{}) *gomock.Call
CreateFile indicates an expected call of CreateFile.
func (*MockPCMockRecorder) ExecInteractive ¶
func (mr *MockPCMockRecorder) ExecInteractive(command, env interface{}) *gomock.Call
ExecInteractive indicates an expected call of ExecInteractive.
func (*MockPCMockRecorder) ExecToString ¶
func (mr *MockPCMockRecorder) ExecToString(command, env interface{}) *gomock.Call
ExecToString indicates an expected call of ExecToString.
func (*MockPCMockRecorder) Exit ¶
func (mr *MockPCMockRecorder) Exit(code interface{}) *gomock.Call
Exit indicates an expected call of Exit.
func (*MockPCMockRecorder) FileExists ¶
func (mr *MockPCMockRecorder) FileExists(filepath interface{}) *gomock.Call
FileExists indicates an expected call of FileExists.
func (*MockPCMockRecorder) Getuid ¶
func (mr *MockPCMockRecorder) Getuid() *gomock.Call
Getuid indicates an expected call of Getuid.
func (*MockPCMockRecorder) Getwd ¶
func (mr *MockPCMockRecorder) Getwd() *gomock.Call
Getwd indicates an expected call of Getwd.
func (*MockPCMockRecorder) HomeDir ¶
func (mr *MockPCMockRecorder) HomeDir() *gomock.Call
HomeDir indicates an expected call of HomeDir.
func (*MockPCMockRecorder) IsTerminal ¶
func (mr *MockPCMockRecorder) IsTerminal() *gomock.Call
IsTerminal indicates an expected call of IsTerminal.
func (*MockPCMockRecorder) Printf ¶
func (mr *MockPCMockRecorder) Printf(format interface{}, a ...interface{}) *gomock.Call
Printf indicates an expected call of Printf.
func (*MockPCMockRecorder) Println ¶
func (mr *MockPCMockRecorder) Println(a ...interface{}) *gomock.Call
Println indicates an expected call of Println.
func (*MockPCMockRecorder) ReadDir ¶
func (mr *MockPCMockRecorder) ReadDir(dirname interface{}) *gomock.Call
ReadDir indicates an expected call of ReadDir.
func (*MockPCMockRecorder) ReadFile ¶
func (mr *MockPCMockRecorder) ReadFile(filename interface{}) *gomock.Call
ReadFile indicates an expected call of ReadFile.
func (*MockPCMockRecorder) WriteFile ¶
func (mr *MockPCMockRecorder) WriteFile(filename, data, perm interface{}) *gomock.Call
WriteFile indicates an expected call of WriteFile.
type PC ¶
type PC interface { ExecInteractive(command []string, env []string) (int, error) ExecToString(command []string, env []string) (int, string, error) Args() []string Exit(code int) HomeDir() (string, error) Getuid() int Getwd() (dir string, err error) FileExists(filepath string) bool ReadFile(filename string) ([]byte, error) ReadDir(dirname string) ([]os.FileInfo, error) CreateFile(filename string) error Chmod(filename string, mode os.FileMode) error CreateDir(path string) error WriteFile(filename string, data []byte, perm os.FileMode) error Printf(format string, a ...interface{}) (n int, err error) Println(a ...interface{}) (n int, err error) IsTerminal() bool }
var Pc PC
type RealPC ¶
type RealPC struct{}
func (*RealPC) CreateFile ¶
func (*RealPC) ExecInteractive ¶
func (*RealPC) ExecToString ¶
func (*RealPC) FileExists ¶
func (*RealPC) IsTerminal ¶
type Workspace ¶
type Workspace struct { Aliases map[string]string ConfigPath string Config *WorkspaceConfig Cwd string WillStart []string Context *Context Components map[string]*Component }
func GetWorkspaceConfig ¶
func NewWorkspace ¶
func (*Workspace) ComponentByName ¶
func (*Workspace) ComponentByPath ¶
func (*Workspace) ComponentNameByPath ¶
func (*Workspace) FindComponentNamesByTag ¶
func (*Workspace) GetComponentNames ¶
func (*Workspace) GetComponentNamesList ¶
func (*Workspace) LoadConfig ¶
type WorkspaceConfig ¶
type WorkspaceConfig struct { Name string `yaml:"name"` ElcMinVersion string `yaml:"elc_min_version"` Components map[string]ComponentConfig `yaml:"components"` Variables yaml.MapSlice `yaml:"variables"` // deprecated Aliases map[string]string `yaml:"aliases"` // deprecated Templates map[string]ComponentConfig `yaml:"templates"` // deprecated Services map[string]ComponentConfig `yaml:"services"` // deprecated Modules map[string]ComponentConfig `yaml:"modules"` }
func NewWorkspaceConfig ¶
func NewWorkspaceConfig() *WorkspaceConfig