clusterinfo

package
v1.0.0-RC Latest Latest
Warning

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

Go to latest
Published: May 21, 2021 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (

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

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)

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 WithKubernetesClient

func WithKubernetesClient(client *kubernetes.Clientset) Option

Jump to

Keyboard shortcuts

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