Documentation ¶
Index ¶
- Constants
- func AuthHandler(cfg *model.Config) func(c *gin.Context)
- func CloseInstanceLoggers()
- func ListInstances(cfg *model.Config) (*[]model.Instance, error)
- func Start(cfg *model.Config) error
- type Instance
- func (i *Instance) Create() error
- func (i *Instance) Exists() (bool, error)
- func (i *Instance) GetIP() (string, error)
- func (i *Instance) GetLogger() *logrus.Logger
- func (i *Instance) GetStatus() *model.Instance
- func (i *Instance) IsRunning() (bool, error)
- func (i *Instance) Remove() error
- func (i *Instance) Reset() error
- func (i *Instance) Restart() error
- func (i *Instance) Save() error
- func (i *Instance) Start() error
- func (i *Instance) StartLogsPipe() error
- func (i *Instance) Stop() error
- func (i *Instance) StopLogsPipe()
- type InstanceContext
- type InstanceLogger
- type JSONError
Constants ¶
const NodeRedPort = "1880"
NodeRedPort default internal node red port
Variables ¶
This section is empty.
Functions ¶
func AuthHandler ¶
AuthHandler handle authentication and authorization
func ListInstances ¶
ListInstances list available instances
Types ¶
type Instance ¶
type Instance struct {
// contains filtered or unexported fields
}
Instance API
func GetInstance ¶
GetInstance return a instance from the cache if available
func NewInstance ¶
NewInstance new instance api
func (*Instance) StartLogsPipe ¶
StartLogsPipe start the container log pipe
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 ¶
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) 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