Documentation ¶
Index ¶
Constants ¶
View Source
const ( //ServiceRegistryCustom for mesos-adapter ServiceRegistryCustom = "custom" //ServiceRegistryKubernetes for bcs kubernetes ServiceRegistryKubernetes = "kubernetes" //ServiceRegistryMesos for mesos etcd storage ServiceRegistryMesos = "mesos" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppNode ¶
type AppNode struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Index string `json:"index"` //node key, pod instance name / taskgroup name Version string `json:"version,omitempty"` //node version, like v1, v1.1, v12.01.1, come from env[BCS_DISCOVERY_VERSION] Weight uint `json:"weight,omitempty"` //node weight, it's a Relative value Network string `json:"network,omitempty"` //app node network mode NodeIP string `json:"nodeIP"` //node ip address ProxyIP string `json:"proxyIP,omitempty"` //proxy ip address for this node Ports []NodePort `json:"ports,omitempty"` //port info for container Spec interface{} `json:"spec,omitempty"` //user custom definition attributes RawBytes string `json:"rawBytes,omitempty"` //raw string for user custom definition }
AppNode node info from Taskgroup/Pod
type AppService ¶
type AppService struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Version string `json:"version,omitempty"` Type string `json:"type,omitempty"` //service type, ClusterIP, Intergration or Empty Frontend []string `json:"frontend,omitempty"` //frontend represents service ip address, use for proxy or intergate Alias string `json:"alias,omitempty"` //domain alias WANIP []string `json:"wanip,omitempty"` //use for wan export Master string `json:"master,omitempty"` //reserved ServicePorts []ServicePort `json:"ports"` //BcsService.Ports Nodes []AppNode `json:"nodes"` //TaskGroup/Pod info Spec interface{} `json:"spec,omitempty"` //user custom definition attributes RawBytes string `json:"rawBytes,omitempty"` //raw string for user custom definition }
AppService internal service structure for container service discovery
type Client ¶
type Client interface { // GetAppService get service by specified namespace & name GetAppService(ns, name string) (*AppService, error) // ListAppService list all service in cache, filter by Label // selector comes from Set.AsSelector() see: k8s.io/apimachinery/pkg/labels.Set ListAppService(labels map[string]string) ([]*AppService, error) // ListAppServiceFromStatefulSet list app services, for each stateful node, generate a AppService object ListAppServiceFromStatefulSet(ns, name string) ([]*AppService, error) // Close client, clean resource Close() }
Client service
type NodeList ¶
type NodeList []AppNode
NodeList list for AppNode
type NodePort ¶
type NodePort struct { Name string `json:"name"` //name for port, must equal to one service port Protocol string `json:"protocol"` //protocol for this port NodePort int `json:"nodeport"` //node port ProxyPort int `json:"proxyport,omitempty"` //proxy port if exists }
NodePort port info for one node of service
type PortList ¶
type PortList []NodePort
PortList list for ports
type ServicePort ¶
type ServicePort struct { Name string `json:"name"` //name for service port Protocol string `json:"protocol"` //protocol for service port Domain string `json:"domain,omitempty"` //domain value for http proxy Path string `json:"path,omitempty"` //http url path ServicePort int `json:"serviceport"` //service port for all AppNode, ServicePort.Name == AppNode.Ports[i].Name ProxyPort int `json:"proxyport,omitempty"` //proxy port for this Service Port if exist TargetPort int `json:"targetport,omitempty"` //target port for this Service Port }
ServicePort port definition for application
type ServicePortList ¶
type ServicePortList []ServicePort
ServicePortList list for sorting
func (ServicePortList) Len ¶
func (list ServicePortList) Len() int
Len is the number of elements in the collection.
func (ServicePortList) Less ¶
func (list ServicePortList) Less(i, j int) bool
Less reports whether the element with index i should sort before the element with index j.
func (ServicePortList) Swap ¶
func (list ServicePortList) Swap(i, j int)
Swap swaps the elements with indexes i and j.
Click to show internal directories.
Click to hide internal directories.