memory

package
v0.0.0-...-ee9fa08 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Registry

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

Registry is an implementation of model.ServiceRegistry.

func NewRegistry

func NewRegistry(services ...*model.Service) *Registry

NewRegistry creates a memory service registry. NOTE: It is designed for unit tests, all methods aren't goroutine-safe.

func (*Registry) AddInstance

func (r *Registry) AddInstance(name string, instances ...*model.ServiceInstance)

AddInstance adds some instances to the specified service.

func (*Registry) DeleteInstance

func (r *Registry) DeleteInstance(name string, instances ...*model.ServiceInstance)

DeleteInstance deletes some instances from the specified service.

func (*Registry) Deregister

func (r *Registry) Deregister(name string) bool

Deregister deregisters a service.

func (*Registry) Get

func (r *Registry) Get(name string) (*model.Service, error)

Get gets the service info with the given name.

func (*Registry) List

func (r *Registry) List() ([]string, error)

List returns all registered service names.

func (*Registry) Register

func (r *Registry) Register(service *model.Service)

Register registers a service.

func (*Registry) Run

func (r *Registry) Run(ctx context.Context)

Run runs the registry.

Jump to

Keyboard shortcuts

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