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) 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
Click to show internal directories.
Click to hide internal directories.