client

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: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GRPCBackoffFunc

type GRPCBackoffFunc func(ctx context.Context, req *GRPCRequest, attempts int) (time.Duration, error)

type GRPCCallOption

type GRPCCallOption func(*GRPCCallOptions)

func GRPCOptionHeaders

func GRPCOptionHeaders(h map[string]string) GRPCCallOption

func GRPCOptionMaxCallRecvMsgSize

func GRPCOptionMaxCallRecvMsgSize(bytes int) GRPCCallOption

func GRPCOptionMaxCallSendMsgSize

func GRPCOptionMaxCallSendMsgSize(bytes int) GRPCCallOption

func GRPCOptionRequestTimeout

func GRPCOptionRequestTimeout(timeout time.Duration) GRPCCallOption

type GRPCCallOptions

type GRPCCallOptions struct {
	Backoff               GRPCBackoffFunc
	Retries               time.Duration
	RequestTimeout        time.Duration
	Context               context.Context
	Headers               map[string]string
	MaxCallSendMsgSize    int
	MaxCallRecvMsgSize    int
	MaxRetryRPCBufferSize int
	CallContentSubtype    string
}

type GRPCClient

type GRPCClient interface {
	GetResolver() resolver.Resolver
	SetResolver(resolver resolver.Resolver)
	Conn(pool string) (grpc.ClientConnInterface, error)
	Call(ctx context.Context, service, method string, req, rsp interface{}, opts ...GRPCCallOption) error
	Stream(ctx context.Context, service, method string, body interface{}, opts ...GRPCCallOption) (grpc.ClientStream, error)
}

type GRPCRequest

type GRPCRequest struct {
	// contains filtered or unexported fields
}

func NewGRPCRequest

func NewGRPCRequest(method, service string, body interface{}, headers map[string]string) *GRPCRequest

func (*GRPCRequest) Body

func (r *GRPCRequest) Body() interface{}

func (*GRPCRequest) Headers

func (r *GRPCRequest) Headers() map[string]string

func (*GRPCRequest) Method

func (r *GRPCRequest) Method() string

func (*GRPCRequest) Service

func (r *GRPCRequest) Service() string

type GRPCRetryFunc

type GRPCRetryFunc func(ctx context.Context, req *GRPCRequest, retryCount int, err error) (bool, error)

type GRPCStream

type GRPCStream grpc.ClientStream

type HTTPClient

type HTTPClient interface {
	Get() error
	Post() error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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