client

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DefaultPoolSize sets the connection pool size
	DefaultPoolSize = 100
	// DefaultPoolTTL sets the connection pool ttl
	DefaultPoolTTL = time.Minute
	// DefaultPoolMaxStreams maximum streams on a connectioin
	// (20)
	DefaultPoolMaxStreams = 20

	// DefaultPoolMaxIdle maximum idle conns of a pool
	// (50)
	DefaultPoolMaxIdle = 50

	// DefaultMaxRecvMsgSize maximum message that client can receive
	// (4 MB).
	DefaultMaxRecvMsgSize = 1024 * 1024 * 4

	// DefaultMaxSendMsgSize maximum message that client can send
	// (4 MB).
	DefaultMaxSendMsgSize = 1024 * 1024 * 4
)

Functions

This section is empty.

Types

type Client

type Client interface {
	grpc.ClientConnInterface
}

func New

func New(opts ...Option) (Client, error)

type Option

type Option func(*options)

func NewFlagSet

func NewFlagSet() (*pflag.FlagSet, Option)

func WithAddress

func WithAddress(address string) Option

func WithDialOptions

func WithDialOptions(opts ...grpc.DialOption) Option

func WithInterceptors

func WithInterceptors(i ...interceptors.ClientInterceptors) Option

func WithName

func WithName(name string) Option

func WithRegistry

func WithRegistry(registry registry.Registry) Option

func WithSecure

func WithSecure(s bool) Option

func WithStreamInterceptors

func WithStreamInterceptors(i ...grpc.StreamClientInterceptor) Option

func WithTLSConfig

func WithTLSConfig(conf *tls.Config) Option

func WithUnaryInterceptors

func WithUnaryInterceptors(i ...grpc.UnaryClientInterceptor) Option

func WithVersion

func WithVersion(version string) Option

type Options

type Options interface {
	Name() string
	Version() string
	Address() string
	Secure() bool
	Registry() registry.Registry
	TLSConfig() *tls.Config
	DialOptions() []grpc.DialOption
	UnaryInterceptors() []grpc.UnaryClientInterceptor
	StreamInterceptors() []grpc.StreamClientInterceptor
}

Jump to

Keyboard shortcuts

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