grpcpool

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2017 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidConn = errors.New("invalid connection")
)

Functions

This section is empty.

Types

type CustomCredential

type CustomCredential struct {
	Token string
}

func (CustomCredential) GetRequestMetadata

func (c CustomCredential) GetRequestMetadata(ctx context.Context, uri ...string) (map[string]string, error)

func (CustomCredential) RequireTransportSecurity

func (c CustomCredential) RequireTransportSecurity() bool

type GRPCPool

type GRPCPool struct {
	sync.RWMutex
	// contains filtered or unexported fields
}
var (
	Pool GRPCPool
)

func (*GRPCPool) Get

func (p *GRPCPool) Get(addr, certFile, token string) (*grpc.ClientConn, error)

func (*GRPCPool) Put

func (p *GRPCPool) Put(addr string, conn *grpc.ClientConn) error

func (*GRPCPool) Release

func (p *GRPCPool) Release(addr string)

释放连接池

func (*GRPCPool) ReleaseAll

func (p *GRPCPool) ReleaseAll()

释放所有连接池

Jump to

Keyboard shortcuts

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