config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

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

func IsRoot

func IsRoot(clusterName string) bool

IsRoot check if clusterName is a root cluster.

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.

Jump to

Keyboard shortcuts

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