clusterinfo

package
v1.3.0-rc.0...-12c9840 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// DiceClusterName dice 集群名
	DiceClusterName = "DICE_CLUSTER_NAME"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ClusterInfo

type ClusterInfo struct {
	*configmap.ConfigMap // k8s configmap client
	// contains filtered or unexported fields
}

ClusterInfo is the object to encapsulate cluster info

func New

func New(clusterName string, options ...Option) (*ClusterInfo, error)

New news an ClusterInfo

func (*ClusterInfo) Get

func (ci *ClusterInfo) Get() (map[string]string, error)

Get 获取集群的 clusterInfo 配置

func (*ClusterInfo) Load

func (ci *ClusterInfo) Load() error

Load 加载对应集群的 clusterInfo 配置

func (*ClusterInfo) LoopLoadAndSync

func (ci *ClusterInfo) LoopLoadAndSync(ctx context.Context, sync bool)

LoopLoadAndSync 循环加载集群信息并存储

func (*ClusterInfo) SyncStore

func (ci *ClusterInfo) SyncStore() error

SyncStore 同步 clusterInfo 数据到存储(比如 ETCD and mysql)

type Option

type Option func(*ClusterInfo)

Option configures an ClusterInfo

func WithCompleteParams

func WithCompleteParams(addr string, client *httpclient.HTTPClient) Option

WithCompleteParams provides an Option

func WithDB

func WithDB(client *instanceinfo.Client) Option

WithCompleteParams provides an Option

Jump to

Keyboard shortcuts

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