utils

package
v0.0.0-...-76f912a Latest Latest
Warning

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

Go to latest
Published: May 30, 2019 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetClientSetRemote

func GetClientSetRemote() *kubernetes.Clientset

func GetClientSetlocal

func GetClientSetlocal() *kubernetes.Clientset

func GetHostName

func GetHostName() (string, error)

func GetHostNodeIP

func GetHostNodeIP(k8s_client *kubernetes.Clientset, hostName string) (string, *v1.NodeList, error)

func ReadKubeConf

func ReadKubeConf(path string) kubeConf

Types

type Broadcaster

type Broadcaster struct {
	// contains filtered or unexported fields
}

Broadcaster holds the details of registered listeners

func NewBroadcaster

func NewBroadcaster() *Broadcaster

NewBroadcaster returns an instance of Broadcaster object

func (*Broadcaster) Add

func (b *Broadcaster) Add(listener Listener)

Add lets to register a listener

func (*Broadcaster) Notify

func (b *Broadcaster) Notify(instance interface{})

Notify notifies an update to registered listeners

type EndPointInfo

type EndPointInfo struct {
	NodeName   *string
	PodName    string
	PodNs      string
	PodIP      net.IP
	EndPntName string
	EndPntNs   string
	Ports      []PortInfo
}

func CreateEndpointInfo

func CreateEndpointInfo(endPoint *v1.Endpoints) *EndPointInfo

func (*EndPointInfo) GetEndPntIdentifier

func (self *EndPointInfo) GetEndPntIdentifier() string

func (*EndPointInfo) GetPodIdentifier

func (self *EndPointInfo) GetPodIdentifier() string

type Listener

type Listener interface {
	OnUpdate(instance interface{})
}

type ListenerFunc

type ListenerFunc func(instance interface{})

func (ListenerFunc) OnUpdate

func (f ListenerFunc) OnUpdate(instance interface{})

type Operation

type Operation int
const (
	ADD Operation = iota
	UPDATE
	REMOVE
	SYNCED
)

type PortInfo

type PortInfo struct {
	PortName string
	PortNo   int32
	Protocol string
	// Extra port info 4 services
	NodePort   int32
	TargetPort int32
}

type ServiceInfo

type ServiceInfo struct {
	SrvName       string
	SrvNs         string
	SrvIP         net.IP
	SrvType       string
	SrvExternalIP []net.IP
	Ports         []PortInfo
}

func CreateServiceInfo

func CreateServiceInfo(service *v1.Service) *ServiceInfo

func (*ServiceInfo) GetSrvIdentifier

func (self *ServiceInfo) GetSrvIdentifier() string

Jump to

Keyboard shortcuts

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