Documentation
¶
Index ¶
- Constants
- Variables
- func AgentBoxStatus(mnt, podId string, repId uint32) string
- func ArrayInt32Equal(a, b []int32) bool
- func ArrayInt32Sort(ls []int32)
- func BoxInstanceName(podId string, repId uint32) string
- func BoxInstanceNameParse(hostname string) (podId string, repId uint32)
- func InPackHostDir(name, version, release, dist, arch string) string
- func InPackMountPath(name, version string) string
- func ObjPrint(name string, v interface{})
- func PodRepNetworkDomainName(podId string, repId uint32) string
- func PodVolSysDir(mnt string, podId string, repId uint32) string
- func PodVolSysDirArch(mnt string, podId string, repId uint32) string
- func VolAgentSysDir(mnt string, podId string, repId uint32) string
- func VolMountPoint(mnt string) string
- func VolPodHomeDir(mnt string, podId string, repId uint32) string
- func VolPodPath(mnt string, podId string, repId uint32, path string) string
- type BoxDriver
- type BoxDriverList
- type BoxInstance
- func (inst *BoxInstance) BlkioDeviceRefresh()
- func (inst *BoxInstance) CpuSets() string
- func (inst *BoxInstance) ExtHosts(excludeRep bool) []string
- func (inst *BoxInstance) OpActionDesired() bool
- func (it *BoxInstance) OpLock() bool
- func (inst *BoxInstance) OpRepKey() string
- func (it *BoxInstance) OpUnlock()
- func (inst *BoxInstance) SpecDesired() bool
- func (inst *BoxInstance) StatusActionSet(op uint32)
- func (it *BoxInstance) StatusLock() bool
- func (it *BoxInstance) StatusUnlock()
- func (inst *BoxInstance) VolumeMountsExport() []string
- func (inst *BoxInstance) VolumeMountsRefresh()
- type BoxInstanceSets
- func (ls *BoxInstanceSets) Del(name string)
- func (ls *BoxInstanceSets) DeviceGet(mnt string) string
- func (ls *BoxInstanceSets) DeviceSet(mnt, dev string) string
- func (ls *BoxInstanceSets) Each(fn func(item *BoxInstance))
- func (ls *BoxInstanceSets) Fix() bool
- func (ls *BoxInstanceSets) Get(name string) *BoxInstance
- func (ls *BoxInstanceSets) OpLockNum() int
- func (ls *BoxInstanceSets) Set(item *BoxInstance)
- func (ls *BoxInstanceSets) Size() int
- func (ls *BoxInstanceSets) SpecCpuSetsDesired(inst *BoxInstance) bool
- func (ls *BoxInstanceSets) StatusSet(item *BoxInstance)
- type BoxInstanceStatsEntry
- type BoxInstanceStatsFeed
- type BoxPackMount
- type RsyncModuleItem
- type SysCpuUsage
- type VolumeDeviceEntry
Constants ¶
View Source
const ( NsOpLogHostletRepSync = "hostlet/rep/sync" NsOpLogHostletRepAction = "hostlet/rep/action" )
View Source
const ( BoxStatsSampleCycle uint32 = 20 BoxStatsLogCycle uint32 = 60 AgentBoxStatusFmt = "%s/%s/home/action/.sysinner/box_status.json" )
Variables ¶
View Source
var ( PodVolSysFmt = "%s/%s" PodVolSysArchFmt = "%s/%s.%s" VolPodHomeFmt = "%s/%s/home/action" VolAgentSysDirFmt = "%s/%s/home/action/.sysinner" BoxInstanceNameReg = regexp.MustCompile("^([0-9a-f]{16,24})-([0-9a-f]{4})$") StatsFeedNames = []string{ "ram/us", "ram/cc", "net/rs", "net/ws", "cpu/us", "fs/rn", "fs/rs", "fs/wn", "fs/ws", } LxcFsVols = []*inapi.PbVolumeMount{} )
Functions ¶
func AgentBoxStatus ¶
func ArrayInt32Equal ¶
func ArrayInt32Sort ¶
func ArrayInt32Sort(ls []int32)
func BoxInstanceName ¶
func BoxInstanceNameParse ¶
func InPackHostDir ¶
func InPackMountPath ¶
func PodRepNetworkDomainName ¶
func VolMountPoint ¶
Types ¶
type BoxDriver ¶
type BoxDriver interface {
Name() string
Start() error
Stop() error
StatusList() []*BoxInstance
StatsList() []*BoxInstanceStatsFeed
ImageSetup(box *BoxInstance) error
BoxCreate(box *BoxInstance) error
BoxStart(box *BoxInstance) error
BoxStop(box *BoxInstance) error
BoxRemove(box *BoxInstance) error
BoxExist(box *BoxInstance) (bool, error)
}
type BoxDriverList ¶
type BoxDriverList struct {
Items []BoxDriver
}
func (*BoxDriverList) Get ¶
func (ls *BoxDriverList) Get(name string) BoxDriver
type BoxInstance ¶
type BoxInstance struct {
ID string `json:"id"`
Name string `json:"name"`
PodID string `json:"pod_id"`
PodOpVersion uint32 `json:"pod_op_version"`
UpUpdated uint32 `json:"up_updated"`
Spec inapi.PodSpecBoxBound `json:"spec"`
Apps inapi.AppInstances `json:"apps"`
Replica inapi.PodOperateReplica `json:"replica"`
Retry int `json:"retry"`
Env []inapi.EnvVar `json:"env"`
Status inapi.PbPodBoxStatus `json:"status"`
HealthStatus inapi.HealthStatus `json:"health_status"`
Stats *inapi.PbStatsSampleFeed `json:"-"`
SysVolSynced int64 `json:"sys_vol_synced"`
SpecCpuSets []int32 `json:"spec_cpu_sets"`
SpecMounts []*inapi.PodSpecBoundMount `json:"spec_mounts"`
PackMounts []*BoxPackMount `json:"pack_mounts"`
SetupHosts []string `json:"setup_hosts"`
BlkioDeviceBps int64 `json:"blkio_device_bps"` // bytes per second
BlkioDeviceIOps int64 `json:"blkio_device_iops"` // IO per second
// contains filtered or unexported fields
}
func (*BoxInstance) BlkioDeviceRefresh ¶
func (inst *BoxInstance) BlkioDeviceRefresh()
func (*BoxInstance) CpuSets ¶
func (inst *BoxInstance) CpuSets() string
func (*BoxInstance) ExtHosts ¶
func (inst *BoxInstance) ExtHosts(excludeRep bool) []string
func (*BoxInstance) OpActionDesired ¶
func (inst *BoxInstance) OpActionDesired() bool
func (*BoxInstance) OpLock ¶
func (it *BoxInstance) OpLock() bool
func (*BoxInstance) OpRepKey ¶
func (inst *BoxInstance) OpRepKey() string
func (*BoxInstance) OpUnlock ¶
func (it *BoxInstance) OpUnlock()
func (*BoxInstance) SpecDesired ¶
func (inst *BoxInstance) SpecDesired() bool
func (*BoxInstance) StatusActionSet ¶
func (inst *BoxInstance) StatusActionSet(op uint32)
func (*BoxInstance) StatusLock ¶
func (it *BoxInstance) StatusLock() bool
func (*BoxInstance) StatusUnlock ¶
func (it *BoxInstance) StatusUnlock()
func (*BoxInstance) VolumeMountsExport ¶
func (inst *BoxInstance) VolumeMountsExport() []string
func (*BoxInstance) VolumeMountsRefresh ¶
func (inst *BoxInstance) VolumeMountsRefresh()
type BoxInstanceSets ¶
type BoxInstanceSets struct {
Items []*BoxInstance `json:"items"`
CpuUsages []*SysCpuUsage `json:"cpu_usages"`
CpuCap int32 `json:"cpu_cap"`
VolDevices []*VolumeDeviceEntry `json:"device_map"`
// contains filtered or unexported fields
}
func (*BoxInstanceSets) Del ¶
func (ls *BoxInstanceSets) Del(name string)
func (*BoxInstanceSets) DeviceGet ¶
func (ls *BoxInstanceSets) DeviceGet(mnt string) string
func (*BoxInstanceSets) DeviceSet ¶
func (ls *BoxInstanceSets) DeviceSet(mnt, dev string) string
func (*BoxInstanceSets) Each ¶
func (ls *BoxInstanceSets) Each(fn func(item *BoxInstance))
func (*BoxInstanceSets) Fix ¶
func (ls *BoxInstanceSets) Fix() bool
func (*BoxInstanceSets) Get ¶
func (ls *BoxInstanceSets) Get(name string) *BoxInstance
func (*BoxInstanceSets) OpLockNum ¶
func (ls *BoxInstanceSets) OpLockNum() int
func (*BoxInstanceSets) Set ¶
func (ls *BoxInstanceSets) Set(item *BoxInstance)
func (*BoxInstanceSets) Size ¶
func (ls *BoxInstanceSets) Size() int
func (*BoxInstanceSets) SpecCpuSetsDesired ¶
func (ls *BoxInstanceSets) SpecCpuSetsDesired(inst *BoxInstance) bool
func (*BoxInstanceSets) StatusSet ¶
func (ls *BoxInstanceSets) StatusSet(item *BoxInstance)
type BoxInstanceStatsEntry ¶
type BoxInstanceStatsFeed ¶
type BoxInstanceStatsFeed struct {
Name string
Time uint32
Items []*BoxInstanceStatsEntry
}
func (*BoxInstanceStatsFeed) Set ¶
func (it *BoxInstanceStatsFeed) Set(name string, value int64)
type BoxPackMount ¶
type RsyncModuleItem ¶
type SysCpuUsage ¶
type VolumeDeviceEntry ¶
Click to show internal directories.
Click to hide internal directories.