Back to

Package grpcresolver

Latest Go to latest

The latest major version is .

Published: Nov 7, 2019 | License: Apache-2.0 | Module:



const GRPCServiceConfig = `{"loadBalancingPolicy":"round_robin"}`

GRPCServiceConfig provides grpc service config

type Resolver

type Resolver struct {
	// contains filtered or unexported fields

Resolver uses notifier to fetch list of available hosts

func New

func New(
	notifier discovery.Notifier,
	discoverer discovery.Discoverer,
	logger *zap.Logger,
	discoveryMinPeers int,
) *Resolver

New initialize a new grpc resolver with notifier

func (*Resolver) Build

func (r *Resolver) Build(target resolver.Target, cc resolver.ClientConn, opts resolver.BuildOption) (resolver.Resolver, error)

Build returns itself for Resolver, because it's both a builder and a resolver.

func (*Resolver) Close

func (r *Resolver) Close()

Close closes both discoCh

func (*Resolver) ResolveNow

func (r *Resolver) ResolveNow(o resolver.ResolveNowOption)

ResolveNow is a noop for Resolver since resolver is already firing every time it receives updates of new instance from discoCh

func (*Resolver) Scheme

func (r *Resolver) Scheme() string

Scheme returns resolver's scheme.

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier