discovery

package
v0.0.0-...-b77c001 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2018 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetNode

func SetNode(node *Node)

Types

type IMap

type IMap interface {
	GetOne() (key, val interface{}, ok bool)

	Set(key interface{}, val interface{}) bool
	Delete(key interface{})
	Iterator() *gomap.Iterator
	Count() int
}

type IServers

type IServers interface {
	GetOne(nodeType int) (uint32, *k8s.Endpoint, bool)
	GetAll(nodeType int) ([]*k8s.Endpoint, bool)
	Set(nodeType int, id uint32, val *k8s.Endpoint)
	Delete(nodeType int, id uint32)
	GetByID(id uint32) (*k8s.Endpoint, bool)
	Count(nodeType int) int
}

func NewServersPolicyRoundRobin

func NewServersPolicyRoundRobin() IServers

type Node

type Node struct {
	k8s.Node
	Servers IServers
	// contains filtered or unexported fields
}

func GetNode

func GetNode() *Node

func NewNode

func NewNode() *Node

func (*Node) GetBase

func (this *Node) GetBase() interface{}

func (*Node) Init

func (this *Node) Init(nodeType int, watchNodeTypes []int, d time.Duration, inst k8s.INode) error

func (*Node) OnNodeJoin

func (this *Node) OnNodeJoin(endpoint *k8s.Endpoint)

func (*Node) OnNodeLeave

func (this *Node) OnNodeLeave(endpoint *k8s.Endpoint)

type Servers

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

func NewServers

func NewServers(creator func() IMap) *Servers

func (*Servers) Count

func (this *Servers) Count(nodeType int) int

func (*Servers) Delete

func (this *Servers) Delete(nodeType int, id uint32)

func (*Servers) GetAll

func (this *Servers) GetAll(nodeType int) ([]*k8s.Endpoint, bool)

func (*Servers) GetByID

func (this *Servers) GetByID(id uint32) (m *k8s.Endpoint, ok bool)

func (*Servers) GetOne

func (this *Servers) GetOne(nodeType int) (uint32, *k8s.Endpoint, bool)

func (*Servers) Set

func (this *Servers) Set(nodeType int, id uint32, val *k8s.Endpoint)

type ServersPolicyRoundRobin

type ServersPolicyRoundRobin struct {
	gomap.RoundRobinMap
}

func (*ServersPolicyRoundRobin) GetOne

func (this *ServersPolicyRoundRobin) GetOne() (key, val interface{}, ok bool)

Jump to

Keyboard shortcuts

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