grpc

package
v0.0.0-...-692e367 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(ctx context.Context, runtime runtime.Runtime) client.GRPCClient

Types

type CallFunc

type CallFunc func(ctx context.Context, addr string, req *client.GRPCRequest, rsp interface{}, opts client.GRPCCallOptions) error

type CallMiddlewareFunc

type CallMiddlewareFunc func(CallFunc) CallFunc

type Codec

type Codec interface {
	Marshal(v interface{}) ([]byte, error)
	Unmarshal(data []byte, v interface{}) error
	Name() string
}

type MiddlewareFunc

type MiddlewareFunc func(client client.GRPCClient) client.GRPCClient

type Options

type Options struct {
	Context context.Context

	ContentType string `env:"CONTENT_TYPE"  envDefault:"application/protobuf" comment:"Set GRPC client request content-type"`

	// Grpc DialOptions
	WriteBufferSize       *int    `` /* 253-byte string literal not displayed */
	ReadBufferSize        *int    `` /* 191-byte string literal not displayed */
	InitialWindowSize     *int32  `` /* 175-byte string literal not displayed */
	InitialConnWindowSize *int32  `` /* 184-byte string literal not displayed */
	MaxHeaderListSize     *int32  `` /* 140-byte string literal not displayed */
	MaxRecvMsgSize        *int    `env:"MAX_RECV_MSG_SIZE" comment:"Sets the maximum message size in bytes the client can receive (default 16 MB)"`
	MaxSendMsgSize        *int    `env:"MAX_SEND_MSG_SIZE" comment:"Sets the maximum message size in bytes the client can send (default 16 MB)"`
	UserAgent             *string `env:"USER_AGENT"  envDefault:"application/protobuf" comment:"Sets the specifies a user agent string for all the RPCs"`
	Resolver              string  `env:"RESOLVER" envDefault:"local" comment:"Define resolver used as service registry [local, file, plugin]. "`

	Selector    selector.Selector
	Pool        PoolOptions
	CallOptions client.GRPCCallOptions
}

type PoolOptions

type PoolOptions struct {
	Size *int           `env:"POOL_SIZE"  envDefault:"" comment:"Set pool size"`
	TTL  *time.Duration `env:"POOL_TTL"  envDefault:"" comment:"Set pool ttl"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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