etcdregistry

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2019 License: MIT Imports: 8 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EtcdRegistry

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

EtcdRegistry lib

func NewEtcdRegistry

func NewEtcdRegistry(etcdEndpoints []string, etcdBasePath string, defaultTimeout time.Duration) (*EtcdRegistry, error)

NewEtcdRegistry EtcdRegistry factory method

func (*EtcdRegistry) GetServiceNodes

func (r *EtcdRegistry) GetServiceNodes(serviceName string) ([]Node, error)

GetServiceNodes returns a list of active service nodes

func (*EtcdRegistry) RegisterNode

func (r *EtcdRegistry) RegisterNode(ctx context.Context, serviceName string, node Node, ttl time.Duration) error

RegisterNode registers a new Node to a service with a TTL. After registration, TTL lease will be kept alive until node is unregistered or process killed

type Node

type Node struct {
	Name string
	Info map[string]string
}

Node registered service node

Jump to

Keyboard shortcuts

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