service

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Addrs     []string
	Timeout   time.Duration
	Secure    bool
	TLSConfig *tls.Config
	Options   map[string]any
}

func NewConfig

func NewConfig(opts ...Setting) *Config

type Discovery

type Discovery interface {
	Init(...Config) error
	ConfigSetting() Setting
	RegisterService(context.Context, Service, ...DiscoveryConfig) error
	Deregister(context.Context, Service, ...DiscoveryConfig) error
	GetService(context.Context, string, ...DiscoveryConfig) ([]Service, error)
	ListServices(context.Context, ...DiscoveryConfig) ([]*Service, error)
	Watch(context.Context, ...DiscoveryConfig) (Watcher, error)
	String() string
}

Discovery provides an interface for service discovery and an abstraction over varying implementations {consul, etcd, zookeeper, ...}

type DiscoveryConfig

type DiscoveryConfig struct {
	TTL time.Duration
}

type Service

type Service interface {
}

type Setting

type Setting func(*Config)

type Watcher

type Watcher interface {
}

Jump to

Keyboard shortcuts

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