registry

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2018 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidAppId        = errors.New("invalid app id")
	ErrInvalidHost         = errors.New("invalid host of url")
	ErrInvalidPort         = errors.New("invalid port of url")
	ErrUnsupportedProtocol = errors.New("invalid protocol of url")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	AppId  string
	NodeId string
	Url    util.URL
	// Election is the callback method which will be invoked while election event happened.
	Election func(event ElectionEvent, masterId string)
}

type ElectionEvent

type ElectionEvent uint8
const (
	MasterTake ElectionEvent = iota
	MasterLose
)

type Registry

type Registry interface {
	misc.Lifecycle
	misc.Sync
	misc.Type
}

func NewRegister

func NewRegister(config Config) (Registry, error)

type Role

type Role uint8
const (
	Slaver Role = iota
	Master
)

Jump to

Keyboard shortcuts

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