spongeregister

package
v0.0.0-...-5fda629 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2022 License: MulanPSL-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeServer        = 1 //服务器
	TypePc            = 2 //个人计算机
	TypeDocker        = 3 //容器
	TypeDevice        = 4 //非计算机的外部设备
	TypeNervous       = 5 //总线
	TypeControlCenter = 6 //控制中心
	TypeStrategy      = 7 //策略
	TypeCluster       = 8 //集群

	StatusPending     = 1
	StatusReady       = 2
	StatusPause       = 3
	StatusError       = 4
	StatusTerminating = 5
	StatusTerminated  = 6

	OpADD = "add"
	OpDEL = "delete"

	// 掉线、重连、更新
	OpUPD = "update"
)

类型

Variables

This section is empty.

Functions

This section is empty.

Types

type ListResources

type ListResources struct {
	// map guid to resource
	Resources map[string]Resource `json:"resources"`
}

type Resource

type Resource struct {
	// 注册生成的guid
	GuId string `json:"guId"`

	// 注册时提供的唯一信息
	// host: host_name + mac
	// container: image_name + rand byte
	Description string `json:"description"`

	// 状态
	Status int    `json:"status"`
	Area   string `json:"area"`

	// 等同depend_node
	PreNode string `json:"preNode"`
	SubNode string `json:"subNode"`

	// 类型
	OType int `json:"oType"`

	// 支持监控
	IsMonitor int `json:"isMonitor"`

	// 支持控制
	IsControl int `json:"isControl"`

	Tags []Tag `json:"tags"`
}

func (*Resource) DeepCopy

func (r *Resource) DeepCopy() *Resource

type ResourceSync

type ResourceSync struct {
	Op string `json:"op"`

	// 注册生成的guid
	GuId string `json:"guId"`

	// 注册时提供的唯一信息
	// host: host_name + mac
	// container: image_id + container_name
	Description string `json:"description"`

	// 状态
	Status int    `json:"status"`
	Area   string `json:"area"`

	// 等同depend_node
	PreNode string `json:"preNode"`
	SubNode string `json:"subNode"`

	// 类型
	OType int `json:"oType"`

	// 支持监控
	IsMonitor int `json:"isMonitor"`

	// 支持控制
	IsControl int `json:"isControl"`

	Tags []Tag `json:"tags"`
}

type SyncInfo

type SyncInfo struct {
	// map [guid] status
	Guids map[string]int `json:"guids"`

	Metrics map[string]SyncMetric `json:"metrics"`
}

type SyncMetric

type SyncMetric struct {
	CpuSet   string
	CpuRatio float64
}

type SyncTagInfo

type SyncTagInfo struct {
	GuId string
	Tag  *Tag
}

type Tag

type Tag struct {
	Key   string      `json:"key"`
	Type  string      `json:"type"`
	Value interface{} `json:"value"`
}

type TagGroupSearchInfo

type TagGroupSearchInfo struct {
	OType  int `json:"oType"`
	Status int `json:"status"`
	Tag    Tag `json:"tag"`
}

Jump to

Keyboard shortcuts

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