Documentation ¶
Index ¶
- Variables
- type Connector
- func (cn *Connector) AddLanguage(lang languages.Language) error
- func (cn *Connector) ExecInContainer(id string, commands []*modo.Do, privileged bool, outputCB modo.OutputFunc, ...) ([]error, error)
- func (cn *Connector) GetCocoonCodeRPCAddr() string
- func (cn *Connector) GetLanguage(name string) languages.Language
- func (cn *Connector) GetLanguages() []languages.Language
- func (cn *Connector) GetOrdererDiscoverer() *orderer.Discovery
- func (cn *Connector) GetSpec() *types.Spec
- func (cn *Connector) HookToMonitor()
- func (cn *Connector) Launch(connectorRPCAddr, cocoonCodeRPCAddr string)
- func (cn *Connector) RestartIfDiskAllocExceeded(curDiskSize int64) bool
- func (cn *Connector) SetAddrs(connectorRPCAddr, cocoonCodeRPCAddr string)
- func (cn *Connector) SetRouterHelper(rh *router.Helper)
- func (cn *Connector) Stop(failed bool) error
- type HealthChecker
Constants ¶
This section is empty.
Variables ¶
var DockerEndpoint = "unix:///var/run/docker.sock"
DockerEndpoint is the endpoint to docker API
Functions ¶
This section is empty.
Types ¶
type Connector ¶
Connector defines a structure for starting and managing a cocoon (ccode)
func NewConnector ¶
NewConnector creates a new connector
func (*Connector) AddLanguage ¶
AddLanguage adds a new langauge to the launcher. Will return error if language is already added
func (*Connector) ExecInContainer ¶
func (cn *Connector) ExecInContainer(id string, commands []*modo.Do, privileged bool, outputCB modo.OutputFunc, stateCB func(modo.State, *modo.Do)) ([]error, error)
ExecInContainer executes one of more commands in a command in series. Returns a any error for each command in their respective index location.
func (*Connector) GetCocoonCodeRPCAddr ¶
GetCocoonCodeRPCAddr returns the RPC address of the cocoon code
func (*Connector) GetLanguage ¶
GetLanguage will return a langauges or nil if not found
func (*Connector) GetLanguages ¶
GetLanguages returns all languages added to the launcher
func (*Connector) GetOrdererDiscoverer ¶
GetOrdererDiscoverer returns the orderer discovery instance
func (*Connector) HookToMonitor ¶
func (cn *Connector) HookToMonitor()
HookToMonitor is where all listeners to the monitor are attached.
func (*Connector) RestartIfDiskAllocExceeded ¶
RestartIfDiskAllocExceeded restarts the cocoon code is disk usages has exceeded its set limit.
func (*Connector) SetRouterHelper ¶
SetRouterHelper sets the router helpder
type HealthChecker ¶
type HealthChecker struct { OnDeadFunc func() // contains filtered or unexported fields }
HealthChecker checks the health status of the cocoon code. It repeatedly calls the cocoon coder health check method. If cocoon code refuses to respond, it calls the OnDeadFunc method attached to it
func NewHealthChecker ¶
func NewHealthChecker(cocoonCodeAddr string, onDeadFunc func()) *HealthChecker
NewHealthChecker creates a cocoon code health checker instance
func (*HealthChecker) Start ¶
func (hc *HealthChecker) Start()
Start runs the health check immediately and on future intervals. if check returns err, it calls the OnDeadFunc and stops the health check.