registry

package
v0.0.0-...-730ab85 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2020 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultPrefix = "/sapi/registry"
)

Functions

This section is empty.

Types

type Option

type Option func(*Options)

type Options

type Options struct {
	Prefix  string
	TTL     int64
	Timeout int64
}

type Registry

type Registry interface {
	Register(option api.Option) error
	Deregister(sv *Service) error
	GetService(name string) ([]*Service, error)
	ListServices() ([]*Service, error)
	Watch() (Watcher, error)
	Close() error
	Type() string
}

type Result

type Result struct {
	Type    int
	Key     string
	Service *Service
}

type Service

type Service struct {
	Driver    string
	Name      string
	ID        string
	Version   string
	Region    string
	Zone      string
	GroupName string
	IP        string
	Port      int
}

type Watcher

type Watcher interface {
	// Next is a blocking call
	Next() (*Result, error)
	Stop()
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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