registor

package
v0.0.0-...-93dd735 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2016 License: Apache-2.0 Imports: 8 Imported by: 5

Documentation

Index

Constants

View Source
const (
	EVT_TYPE_NEW    = EvtType(0)
	EVT_TYPE_UPDATE = EvtType(1)
	EVT_TYPE_DELETE = EvtType(2)
)
View Source
const (
	EVT_SRC_SUPPORT = EvtSrc(0)
	EVT_SRC_ROUTER  = EvtSrc(1)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type EtcdRegistor

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

func (EtcdRegistor) DeregisterRouter

func (self EtcdRegistor) DeregisterRouter(router *model.Router) error

func (EtcdRegistor) DeregistorSupport

func (self EtcdRegistor) DeregistorSupport(support *model.Support) error

func (EtcdRegistor) GetSupports

func (self EtcdRegistor) GetSupports() ([]*model.Support, error)

func (EtcdRegistor) RegisterRouter

func (self EtcdRegistor) RegisterRouter(router *model.Router, ttl uint64) error

func (EtcdRegistor) RegistorSupport

func (self EtcdRegistor) RegistorSupport(support *model.Support, ttl uint64) error

func (EtcdRegistor) RegistorWatchHandler

func (self EtcdRegistor) RegistorWatchHandler(evtSrc EvtSrc, evtType EvtType, handler func(evt *Evt))

func (EtcdRegistor) Watch

func (self EtcdRegistor) Watch(stopCh chan bool) error

type Evt

type Evt struct {
	Src   EvtSrc
	Type  EvtType
	Key   string
	Value interface{}
}

type EvtSrc

type EvtSrc int

type EvtType

type EvtType int

type Registor

type Registor interface {
	RegistorSupport(support *model.Support, ttl uint64) error
	DeregistorSupport(support *model.Support) error

	RegisterRouter(router *model.Router, ttl uint64) error
	DeregisterRouter(router *model.Router) error

	GetSupports() ([]*model.Support, error)

	RegistorWatchHandler(evtSrc EvtSrc, evtType EvtType, handler func(evt *Evt))
	Watch(stopCh chan bool) error
}

func NewEtcdRegistor

func NewEtcdRegistor(etcdAddrs []string, prefix string) Registor

Jump to

Keyboard shortcuts

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