clusterinfo

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2021 License: Apache-2.0 Imports: 16 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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