Documentation ¶
Index ¶
- Variables
- type Config
- type EnvVal
- type Instance
- type LoadError
- type Loader
- type Maestro
- func (m *Maestro) GetContainerHostAddress() (string, error)
- func (m *Maestro) GetContainerName() (string, error)
- func (m *Maestro) GetEnvironmentName() string
- func (m *Maestro) GetNodeList(service string, ports []string) []string
- func (m *Maestro) GetPort(name string) (uint16, error)
- func (m *Maestro) GetServiceName() (string, error)
- func (m *Maestro) GetSpecificExposedPort(service string, container string, port string) (uint16, error)
- func (m *Maestro) GetSpecificHost(service string, container string) (string, error)
- func (m *Maestro) GetSpecificPort(service string, container string, port string) (uint16, error)
- type Port
- type Service
- type Ships
Constants ¶
This section is empty.
Variables ¶
var ErrContainerHostAddrNotDefined = errors.New("container host address was not defined")
ErrContainerHostAddrNotDefined is returned when GetContainerHostAddress is not defined
var ErrNoContainerName = errors.New("container name was not defined")
ErrNoContainerName is returned when GetContainerName is not defined
var ErrNoServiceName = errors.New("service name was not defined")
ErrNoServiceName is returned when GetServiceName is not defined
var ErrNoSpecificHostDefined = errors.New("no host defined for container of service")
ErrNoSpecificHostDefined is returned when GetSpecificHost cannot find the host in the container
var ErrPortNotDefined = errors.New("port env not defined")
ErrPortNotDefined is returned when the port cannot be found
Functions ¶
This section is empty.
Types ¶
type Config ¶
A Config is our maestro config
func (*Config) ShipsForService ¶
ShipsForService is a helper that gets the connections for a service inside a config
type Instance ¶
Instance running code
func ArbitraryInstance ¶
ArbitraryInstance returns a (possibly random) instance in a map, or panics if the map is empty
type LoadError ¶
type LoadError struct {
// contains filtered or unexported fields
}
LoadError is returned when Load() fails, including extra information about the python error.
type Loader ¶
type Loader struct { ExecFunc func(name string, stdin string, args ...string) (string, string, error) PythonLocation string }
Loader can load a maestro config execing out to the python module and returning its json object.
type Maestro ¶
type Maestro struct {
// contains filtered or unexported fields
}
Maestro is the golang client for https://github.com/signalfuse/maestro-ng
func New ¶
New creates a new maestro client, using the given function to get env variables. You usually want to call New(os.Getenv)
func (*Maestro) GetContainerHostAddress ¶
GetContainerHostAddress returns the publicly-addressable IP address of the host of the container
func (*Maestro) GetContainerName ¶
GetContainerName returns the name of the container calling it
func (*Maestro) GetEnvironmentName ¶
GetEnvironmentName returns the name of the environment the container calling this in a part of
func (*Maestro) GetNodeList ¶
GetNodeList builds a list of nodes for the given service from the environment, eventually adding the ports from the list of port names. The resulting entries will be of the form 'host[:port1[:port2]]' and sorted by container name.
func (*Maestro) GetServiceName ¶
GetServiceName returns the service name of the container calling it
func (*Maestro) GetSpecificExposedPort ¶
func (m *Maestro) GetSpecificExposedPort(service string, container string, port string) (uint16, error)
GetSpecificExposedPort returns the exposed (internal) port number of a specific port of a specific container from a given service.
func (*Maestro) GetSpecificHost ¶
GetSpecificHost returns the hostname/address of a specific container/instance of the given service
type Port ¶
type Port interface{}
Port is the port a service is running in. Can sometimes be port ranges...