api

package
v2.0.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2017 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const NodeRedPort = "1880"

NodeRedPort default internal node red port

Variables

This section is empty.

Functions

func AuthHandler

func AuthHandler(cfg *model.Config) func(c *gin.Context)

AuthHandler handle authentication and authorization

func CloseInstanceLoggers

func CloseInstanceLoggers()

CloseInstanceLoggers close all file loggers

func ListInstances

func ListInstances(cfg *model.Config) (*[]model.Instance, error)

ListInstances list available instances

func Start

func Start(cfg *model.Config) error

Start start API HTTP server

Types

type Instance

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

Instance API

func GetInstance

func GetInstance(name string, cfg *model.Config) *Instance

GetInstance return a instance from the cache if available

func NewInstance

func NewInstance(name string, cfg *model.Config) *Instance

NewInstance new instance api

func (*Instance) Create

func (i *Instance) Create() error

Create instance without starting

func (*Instance) Exists

func (i *Instance) Exists() (bool, error)

Exists check if the instance has been stored

func (*Instance) GetIP

func (i *Instance) GetIP() (string, error)

GetIP return the container IP

func (*Instance) GetLogger

func (i *Instance) GetLogger() *logrus.Logger

GetLogger Return the dedicated logger

func (*Instance) GetStatus

func (i *Instance) GetStatus() *model.Instance

GetStatus return the current instance known status

func (*Instance) IsRunning

func (i *Instance) IsRunning() (bool, error)

IsRunning check if the instance is running

func (*Instance) Remove

func (i *Instance) Remove() error

Remove instance and stop it if running

func (*Instance) Reset

func (i *Instance) Reset() error

Reset reset container runtime information

func (*Instance) Restart

func (i *Instance) Restart() error

Restart instance

func (*Instance) Save

func (i *Instance) Save() error

Save instance status

func (*Instance) Start

func (i *Instance) Start() error

Start an instance creating a record for if it does not exists

func (*Instance) StartLogsPipe

func (i *Instance) StartLogsPipe() error

StartLogsPipe start the container log pipe

func (*Instance) Stop

func (i *Instance) Stop() error

Stop instance without removing

func (*Instance) StopLogsPipe

func (i *Instance) StopLogsPipe()

StopLogsPipe stop the container log pipe

type InstanceContext

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

InstanceContext tracks internal context for the instance

func NewInstanceContext

func NewInstanceContext() *InstanceContext

NewInstanceContext craeate a new instance context

func (*InstanceContext) Cancel

func (c *InstanceContext) Cancel()

Cancel the instance level context

func (*InstanceContext) GetContext

func (c *InstanceContext) GetContext() context.Context

GetContext return the real context reference

type InstanceLogger

type InstanceLogger struct {
	Name string
	Path string
	// contains filtered or unexported fields
}

InstanceLogger a logger for a container instance

func NewInstanceLogger

func NewInstanceLogger(name string, path string) (*InstanceLogger, error)

NewInstanceLogger create a new instance and cache it

func (*InstanceLogger) Close

func (i *InstanceLogger) Close()

Close close open file loggers

func (*InstanceLogger) GetFile

func (i *InstanceLogger) GetFile() io.Writer

GetFile return the file writer

func (*InstanceLogger) GetLogger

func (i *InstanceLogger) GetLogger() *logrus.Logger

GetLogger return the actual logger

type JSONError

type JSONError struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

JSONError a JSON response in case of error

Jump to

Keyboard shortcuts

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