discovery

package
v0.0.0-...-6976cfd Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2016 License: MIT Imports: 2 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnnounceResolver

type AnnounceResolver interface {
	Resolver
	Announcer
}

AnnounceResolver groups Announcer and Resolver interfaces.

type Announcer

type Announcer interface {
	Announce(string, Instance) error
}

Announcer describes something that can announce a service instance to make it available for discovery.

type Instance

type Instance struct {
	ID       string
	Endpoint string
	Meta     InstanceMeta
}

TODO: Add possibility to update announced instance metadata. Instance represents an RPC instance, usually this map to one process.

func NewInstance

func NewInstance(endpoint string, meta InstanceMeta) Instance

NewInstance creates a new Instance.

type InstanceMeta

type InstanceMeta map[string]interface{}

InstanceMeta represents metadata associated with an instance.

type Resolver

type Resolver interface {
	Resolve(string) (*Service, error)
}

Resolver describes something that can resolve services from name.

type Service

type Service struct {
	Name      string
	Instances []Instance
}

Service represents an RPC service, which is an abstract definition of RPC instances announced under the same name.

func (*Service) String

func (s *Service) String() string

String returns a representation string of service.

Directories

Path Synopsis
package loadbalancer defines how to balance and distribute requests between multiple service instances.
package loadbalancer defines how to balance and distribute requests between multiple service instances.
package zookeeper contains definition of discovery logic to announce rpc instances in zookeeper and resolve them.
package zookeeper contains definition of discovery logic to announce rpc instances in zookeeper and resolve them.

Jump to

Keyboard shortcuts

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