etcd

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDiscover

func NewDiscover(config *Config, client *clientV3.Client, etcdConfig *clientV3.Config) (*discover, error)

Types

type Config

type Config struct {
	Name    string // the name for registry store the instance, unique. If empty will use the combine: Scheme, Service replace.
	Scheme  string // register resolver with name scheme, like: services
	Service string // service name, like: test/v1.0/grpc

	ChannelBufferSize int // default 256, for errors or messages channel

	// Return specifies what will be populated. If they are set to true,
	// you must read from them to prevent deadlock.
	Return struct {
		// If enabled, any errors that occurred while consuming are returned on
		// the Errors channel (default disabled).
		Errors bool
		// If enabled, any messages that occurred while consuming are returned on
		// the Messages channel (default disabled).
		Messages bool
	}
	ErrorsHandler   func(err <-chan error)               // consume errors, if not set drop.
	MessagesHandler func(string <-chan string)           // consume messages expect errors, if not set drop.
	AddressesParser func(string, []byte) (string, error) // parse address, k string, val []byte, return address string.
	Logger          *log.Logger                          // shall not set, use for debug
}

Jump to

Keyboard shortcuts

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