memory

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2019 License: Apache-2.0 Imports: 8 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

Overview

Package memory provides an in-memory registry

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultTTL = 1 * time.Minute
)

Functions

func NewRegistry

func NewRegistry(opts ...registry.Option) registry.Registry

func Services added in v0.22.1

func Services(s map[string][]*registry.Service) registry.Option

Services is an option that preloads service data

Types

type Registry

type Registry struct {
	sync.RWMutex
	Services map[string][]*registry.Service

	Watchers map[string]*Watcher
	// contains filtered or unexported fields
}

func (*Registry) Deregister

func (m *Registry) Deregister(s *registry.Service) error

func (*Registry) GetService

func (m *Registry) GetService(name string) ([]*registry.Service, error)

func (*Registry) Init

func (m *Registry) Init(opts ...registry.Option) error

func (*Registry) ListServices

func (m *Registry) ListServices() ([]*registry.Service, error)

func (*Registry) Options

func (m *Registry) Options() registry.Options

func (*Registry) Register

func (m *Registry) Register(s *registry.Service, opts ...registry.RegisterOption) error

func (*Registry) String

func (m *Registry) String() string

func (*Registry) Watch

func (m *Registry) Watch(opts ...registry.WatchOption) (registry.Watcher, error)

type Watcher added in v0.22.1

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

func (*Watcher) Next added in v0.22.1

func (m *Watcher) Next() (*registry.Result, error)

func (*Watcher) Stop added in v0.22.1

func (m *Watcher) Stop()

Jump to

Keyboard shortcuts

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