Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AttrKey ¶
type AttrKey int
const ( NamespaceAttr AttrKey = 0x0000 // K8sPod ContainerIDsAttr AttrKey = 0x0010 // string containerID1,containerID2,... PodLabelsAttr AttrKey = 0x0011 // extra map[string]string PodIP AttrKey = 0x0012 // string PodPhase AttrKey = 0x0013 // string Pending / Running PodHostName AttrKey = 0x0014 // string PodHostIP AttrKey = 0x0015 // string PodHostNetwork AttrKey = 0x0016 // bool Name2Port AttrKey = 0x0017 // extra map[string]string // K8sService ServiceSelectorsAttr AttrKey = 0x0020 // extra map[string]string ServiceIP AttrKey = 0x0021 // string ServiceEndpoints AttrKey = 0x0022 // string ip1,ip2,... ServicePorts2TargetPorts AttrKey = 0x0023 // string name:port-targetPort-nodePort,name2:port-targetPort-nodePort // Node NodeInternalIP AttrKey = 0x0030 NodeExternalIP AttrKey = 0x0031 NodeHostName AttrKey = 0x0032 // OwnerAttribute OwnerName AttrKey = 0x0111 OwnerType AttrKey = 0x0112 )
K8sMetadata
type CheckPoint ¶
func (*CheckPoint) Equals ¶
func (p *CheckPoint) Equals(cp *CheckPoint) bool
type Exporter ¶
type Exporter interface { SetupResourcesRef(resources *Resources) ExportResourceEvents(events *ResourceEvent) }
type FetchRequest ¶
type FetchRequest struct {
ResourceTypes []ResType
}
type HandlerTemplate ¶
type HandlerTemplate func(resType ResType, resources []*Resource) ResHandler
type Relation ¶
type Relation struct { ResUID ResUID ReType RelationType StringAttr map[AttrKey]string `json:"strAttrMap"` }
type RelationRef ¶
type RelationType ¶
type RelationType int
const ( R_OWNER RelationType = 0x0001 R_ENDPOINT RelationType = 0x0003 )
type ResHandler ¶
type ResOperation ¶
type ResOperation int
const ( AddOP ResOperation = 0 UpdateOP ResOperation = 1 DeleteOP ResOperation = 2 ResetOP ResOperation = 3 )
type ResVersion ¶
type ResVersion string
type Resource ¶
type Resource struct { ResUID ResType // Last updated timestamp ResVersion Name string `json:"name"` Relations []Relation `json:"relations"` StringAttr map[AttrKey]string `json:"strAttrMap"` Int64Attr map[AttrKey]int64 `json:"int64AttrMap"` // Labels for Pod // Selector for services ExtraAttr map[AttrKey]map[string]string `json:"extraInfo"` }
type ResourceEvent ¶
type ResourceEvent struct { // 事件来源的集群ID ClusterID string Res []*Resource ResourceType ResType Operation ResOperation }
type Resources ¶
type Resources struct { ResList []*Resource ResType ResType ClusterID string // add lock/unlock... ExportMux sync.RWMutex Exporter }
func NewResources ¶
func (*Resources) AddResource ¶
func (*Resources) DeleteResource ¶
func (*Resources) SetClusterID ¶
func (*Resources) SetExporter ¶
func (*Resources) UpdateResource ¶
type SyncRequest ¶
type SyncRequest struct { Events []*ResourceEvent // 上次更新时间 LastCheckPoint *CheckPoint // 本次更新结束时间 CheckPoint *CheckPoint }
func (*SyncRequest) IsHealthCheck ¶
func (r *SyncRequest) IsHealthCheck() bool
IsHealthCheck 是否是初始化信号 LastCheckPoint为nil,表示未曾提交过数据,此时不会提供其他数据
func (*SyncRequest) IsInitRequest ¶
func (r *SyncRequest) IsInitRequest() bool
func (*SyncRequest) IsSyncCheck ¶
func (r *SyncRequest) IsSyncCheck() bool
IsSyncCheck 是否是同步检查信号 CheckPoint和Events都为nil, 表示不做更新, 仅检查LastCheckPoint状态
type SyncResponse ¶
type SyncResponse struct { LastCheckPoint *CheckPoint IsStopPush bool IsInit bool IsAccepted bool }
Click to show internal directories.
Click to hide internal directories.