Documentation ¶
Overview ¶
Package config defines data structure needed by cluster controller, and const of cluster controller.
Index ¶
Constants ¶
View Source
const ( // RootClusterName defines the cluster name of root cluster. RootClusterName = "Root" // ClusterConnectHeaderListenAddr defines request header to post listen address of the child. // For edge when connect to parent, set this header to address listened by the cluster, // so let parent know the address of child, thus a cluster can get its neighbor from parent. ClusterConnectHeaderListenAddr = "listen-addr" // ClusterConnectHeaderUserDefineName is the user-define name of the child ClusterConnectHeaderUserDefineName = "name" // K8sInformerSyncDuration defines k8s informer sync seconds. K8sInformerSyncDuration = 10 )
Variables ¶
View Source
var (
ErrDuplicatedName = fmt.Errorf("cluster name duplicated")
)
ErrDuplicatedName is error message format.
Functions ¶
Types ¶
type ClusterControllerConfig ¶
type ClusterControllerConfig struct { TunnelListenAddr string LeaderListenAddr string ParentCluster string ClusterName string ClusterUserDefineName string KubeConfig string HelmTillerAddr string RemoteShimAddr string K8sClient oteclient.Interface EdgeToClusterChan chan clustermessage.ClusterMessage ClusterToEdgeChan chan clustermessage.ClusterMessage }
ClusterControllerConfig contains config needed by cluster controller.
type ClusterRegistry ¶
type ClusterRegistry struct { Name string // uuid UserDefineName string Listen string Time int64 ParentName string }
ClusterRegistry defines a data structure to use when a cluster regists.
func ClusterRegistryDeserialize ¶
func ClusterRegistryDeserialize(b []byte) (*ClusterRegistry, error)
ClusterRegistryDeserialize is for the ClusterRegistry deserialize.
func (*ClusterRegistry) Serialize ¶
func (cr *ClusterRegistry) Serialize() ([]byte, error)
Serialize is for the ClusterRegistry serialization method.
func (*ClusterRegistry) WrapperToClusterMessage ¶
func (cr *ClusterRegistry) WrapperToClusterMessage( command clustermessage.CommandType) (*clustermessage.ClusterMessage, error)
WrapperToClusterMessage is wrapper to ClusterMessage for ClusterRegistry.
Click to show internal directories.
Click to hide internal directories.