Documentation ¶
Index ¶
- Constants
- Variables
- func CreateCmd(name string, filePath string) error
- func DefinitionFilePath(name string) (path string)
- func Delete(name string) error
- func Exists(name string) bool
- func ExportCmd(name string) error
- func FileFolder() (path string)
- func InspectCmd(name string) error
- func ListCmd() error
- func RemoveCmd(name string) error
- func StateFilePath(name string) (path string)
- func UpdateCmd(name string, filePath string) error
- func Validate(stackName string, filePath string) error
- func Write(name string, sourceFilePath string) error
- type Container
- type NodeLoad
- type ServiceDefinition
- type ServiceState
- type Stack
- type StackInterface
Constants ¶
View Source
const ( SERVICE_SCHEMA = `` /* 1753-byte string literal not displayed */ NAME_SCHEMA = `` /* 144-byte string literal not displayed */ )
View Source
const (
FILL_SIZE = 30
)
Variables ¶
View Source
var Commands = cli.Command{ Name: "stack", Usage: "manage stacks", Subcommands: []cli.Command{ { Name: "create", Usage: "create a stack", Action: func(c *cli.Context) { if len(c.Args()) != 2 { log.Fatal("'create' command accepts 2 arguments, the name of the stack and the path to the YAML elora template") } err := CreateCmd(c.Args()[0], c.Args()[1]) if err != nil { log.Fatal(err) } }, }, { Name: "inspect", ShortName: "get", Usage: "get the information of a stack", Action: func(c *cli.Context) { if len(c.Args()) != 1 { log.Fatal("'get' command only accepts one argument, the name of the stack") } err := InspectCmd(c.Args().First()) if err != nil { log.Fatal(err) } }, }, { Name: "export", Usage: "get the elora YAML template of a stack", Action: func(c *cli.Context) { if len(c.Args()) != 1 { log.Fatal("'export' command only accepts one argument, the name of the stack") } err := ExportCmd(c.Args().First()) if err != nil { log.Fatal(err) } }, }, { Name: "list", ShortName: "ls", Usage: "list the elora current stacks", Action: func(c *cli.Context) { if len(c.Args()) != 0 { log.Fatal("'list' command does not have arguments") } err := ListCmd() if err != nil { log.Fatal(err) } }, }, { Name: "update", ShortName: "up", Usage: "update a stack", Action: func(c *cli.Context) { if len(c.Args()) != 2 { log.Fatal("'update' command accepts 2 arguments, the name of the stack and the path to its new YAML elora template") } err := UpdateCmd(c.Args()[0], c.Args()[1]) if err != nil { log.Fatal(err) } }, }, { Name: "remove", ShortName: "rm", Usage: "remove a stack", Action: func(c *cli.Context) { if len(c.Args()) != 1 { log.Fatal("'remove' command only accepts one argument, the name of stack to remove") } err := RemoveCmd(c.Args().First()) if err != nil { log.Fatal(err) } }, }, }, }
Functions ¶
func DefinitionFilePath ¶
func FileFolder ¶
func FileFolder() (path string)
func InspectCmd ¶
func StateFilePath ¶
Types ¶
type ServiceDefinition ¶
type ServiceDefinition struct { Image string `json:"image"` Command string `json:"command"` Links []string `json:"links"` Ports []string `json:"ports"` Volumes []string `json:"volumes"` Volumes_from []string `json:"volumes_from"` Environment []string `json:"environment"` Entrypoint string `json:"entrypoint"` Mem_limit string `json:"mem_limit"` Privileged bool `json:"privileged"` Restart string `json:"restart"` Strategy string `json:"strategy"` Scale int `json:"scale"` Tags []string `json:"tags"` }
type ServiceState ¶
type Stack ¶
type Stack struct { Name string Operation string Definition map[string]ServiceDefinition Services map[string]ServiceState }
func (*Stack) SetBestNodes ¶
func (*Stack) SetDefaults ¶
func (s *Stack) SetDefaults()
type StackInterface ¶
type StackInterface interface{}
Click to show internal directories.
Click to hide internal directories.