lb

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConsulResolver

type ConsulResolver struct {
	ServiceName string // service name
	Target      string
	Addr        string
	Addresses   []string
	Scheme      string
	Verbose     int
	Namespace   string
}

ConsulResolver is the implementaion of grpc.naming.Resolver

func NewResolver

func NewResolver(serviceName string, namespace string, target string, addr string) *ConsulResolver

NewResolver return ConsulResolver with service name

func (*ConsulResolver) GetFirst

func (cr *ConsulResolver) GetFirst() (addr string)

GetFirst - возвращает первый адрес из списка

func (*ConsulResolver) Resolve

func (cr *ConsulResolver) Resolve(target string) (naming.Watcher, error)

Resolve to resolve the service from consul, target is the dial address of consul

type ConsulWatcher

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

ConsulWatcher is the implementation of grpc.naming.Watcher

func (*ConsulWatcher) Close

func (cw *ConsulWatcher) Close()

Close do nonthing

func (*ConsulWatcher) Next

func (cw *ConsulWatcher) Next() ([]*naming.Update, error)

Next to return the updates

Jump to

Keyboard shortcuts

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