conn

package
v3.7.0 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Created = State(iota)
	Online
	Banned
	Offline
	Destroyed
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config interface {
	DialTimeout() time.Duration
	RequestTimeout() time.Duration
	OperationTimeout() time.Duration
	OperationCancelAfter() time.Duration
	StreamTimeout() time.Duration
	Trace() trace.Driver
	ConnectionTTL() time.Duration
	GrpcDialOptions() []grpc.DialOption
}

type Conn

type Conn interface {
	grpc.ClientConnInterface

	Endpoint() endpoint.Endpoint
	GetState() State
	SetState(context.Context, State) State
	Close(ctx context.Context) error
	Park(ctx context.Context) error
	TTL() <-chan time.Time
}

func New

func New(endpoint endpoint.Endpoint, config Config) Conn

type Pool added in v3.7.0

type Pool interface {
	closer.Closer

	Get(endpoint endpoint.Endpoint) Conn
	Pessimize(ctx context.Context, e endpoint.Endpoint) error
}

func NewPool added in v3.7.0

func NewPool(ctx context.Context, config Config) Pool

type PoolConfig added in v3.7.0

type PoolConfig interface {
	ConnectionTTL() time.Duration
	GrpcDialOptions() []grpc.DialOption
}

type State added in v3.7.0

type State int8

func (State) Code added in v3.7.0

func (s State) Code() int

func (State) IsValid added in v3.7.0

func (s State) IsValid() bool

func (State) String added in v3.7.0

func (s State) String() string

Jump to

Keyboard shortcuts

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