zkregistry

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2016 License: MIT Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNilConn         = errors.New("can't create registry with <nil> zk connection")
	ErrServiceNotFound = errors.New("service not found")
)

Common errors.

View Source
var ParseConfigPath = parseConfigPath

ParseConfigPath extracts name, version and endpoint from a Zookeeper event.

Functions

This section is empty.

Types

type ZKRegistry

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

ZKRegistry is an implementation of the registry with Zookeeper.

func New

func New(conn *zk.Conn, zkPath string, logger zk.Logger) (*ZKRegistry, error)

New .

func (*ZKRegistry) Add

func (reg *ZKRegistry) Add(name, version, endpoint string)

Add adds the given endpoit for the service name/version.

func (*ZKRegistry) Close

func (reg *ZKRegistry) Close() error

Close terminates the registry.

func (*ZKRegistry) DeleteEndpoint

func (reg *ZKRegistry) DeleteEndpoint(name, version, endpoint string)

DeleteEndpoint removes the given endpoit for the service name/version.

func (*ZKRegistry) DeleteService

func (reg *ZKRegistry) DeleteService(name string)

DeleteService removes the given service.

func (*ZKRegistry) DeleteVersion

func (reg *ZKRegistry) DeleteVersion(name, version string)

DeleteVersion removes the given version for the service name.

func (*ZKRegistry) Failure

func (reg *ZKRegistry) Failure(name, version, endpoint string, err error)

Failure marks the given endpoint for service name/version as failed.

func (*ZKRegistry) Lookup

func (reg *ZKRegistry) Lookup(name, version string) ([]string, error)

Lookup return the endpoint list for the given service name/version.

func (*ZKRegistry) SetLogger

func (reg *ZKRegistry) SetLogger(logger zk.Logger) *ZKRegistry

SetLogger overrides the default logger.

func (*ZKRegistry) String

func (reg *ZKRegistry) String() string

String returns the json representation of the registered services. NOTE: induces a lock. You should not let users call this.

Jump to

Keyboard shortcuts

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