Documentation
¶
Index ¶
- Constants
- func Factories() map[string]Factory
- func GenerateInstanceEnv(name string, static []string, dynamic map[string]string) []string
- func Supervising(instance Instance) error
- type Engine
- type Factory
- type InfoStats
- type Instance
- type InstancesStats
- type PartialStats
- type Service
- type ServicesStats
Constants ¶
View Source
const ( KeyName = "name" KeyStatus = "status" KeyCreateTime = "create_time" KeyStartTime = "start_time" KeyFinishTime = "finish_time" // Created = "created" // 已创建 Running = "running" // 运行中 // Paused = "paused" // 已暂停 Restarting = "restarting" // 重启中 // Removing = "removing" // 退出中 // Exited = "exited" // 已退出 Dead = "dead" // 未启动(默认值) )
all status
Variables ¶
This section is empty.
Functions ¶
func GenerateInstanceEnv ¶
GenerateInstanceEnv generates new env of the instance
Types ¶
type Engine ¶
type Engine interface {
io.Closer
Name() string
Recover()
Prepare([]openedge.ServiceInfo)
SetInstanceStats(serviceName, instanceName string, partialStats PartialStats, persist bool)
DelInstanceStats(serviceName, instanceName string, persist bool)
DelServiceStats(serviceName string, persist bool)
Run(openedge.ServiceInfo, map[string]openedge.VolumeInfo) (Service, error)
}
Engine interface
type InfoStats ¶
type InfoStats interface {
LoadStats(sss interface{}) bool
SetInstanceStats(serviceName, instanceName string, partialStats PartialStats, persist bool)
DelInstanceStats(serviceName, instanceName string, persist bool)
DelServiceStats(serviceName string, persist bool)
}
InfoStats interfaces of the storage of info and stats
type Instance ¶
type Instance interface {
Service() Service
Name() string
Info() PartialStats
Stats() PartialStats
Wait(w chan<- error)
Dying() <-chan struct{}
Restart() error
Stop()
io.Closer
}
Instance interfaces of instance
type InstancesStats ¶
type InstancesStats map[string]PartialStats
InstancesStats stats of all instances of the service
type PartialStats ¶
type PartialStats map[string]interface{}
PartialStats partial stats of the instance
func NewPartialStatsByStatus ¶
func NewPartialStatsByStatus(status string) PartialStats
NewPartialStatsByStatus creates a new stats by status
type Service ¶
type Service interface {
Name() string
Engine() Engine
RestartPolicy() openedge.RestartPolicyInfo
Start() error
Stop()
Stats()
StartInstance(instanceName string, dynamicConfig map[string]string) error
StopInstance(instanceName string) error
}
Service interfaces of service
type ServicesStats ¶
type ServicesStats map[string]InstancesStats
ServicesStats stats of all services
Click to show internal directories.
Click to hide internal directories.