naming

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2020 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Overview

package naming is interface for both registry register/unregister and grpc builder/resolver

Index

Constants

View Source
const (
	// PREFIX uses here to differentiate between denny etcd prefix and other service prefix
	// in etcd directory/files
	Prefix = "_DENNY_"
)

Variables

This section is empty.

Functions

func DefaultBalancePolicy

func DefaultBalancePolicy() grpc.DialOption

DefaultBalancePolicy returns default grpc service config which required by new grpc API so client does not have to supply json config everytime

func Exist

func Exist(l []resolver.Address, addr string) bool

Exist checks if given addr is already exist in grpc resolver address list

func Remove

func Remove(s []resolver.Address, addr string) ([]resolver.Address, bool)

Remove removes an address from grpc resolver address list (because it's no longer available in naming registry)

Types

type Registry

type Registry interface {
	Register(addr string, ttl int) error
	UnRegister(addr string) error
	Build(target resolver.Target, cc resolver.ClientConn, opts resolver.BuildOptions) (resolver.Resolver, error)
	Scheme() string
	SvcName() string
}

Registry is based interface, which is composed of grpc resolver.Builder, resolver.Resolver and also contains method to register and unregister from naming storage

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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