invoker

package
Version: v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2022 License: MIT Imports: 8 Imported by: 1

Documentation

Overview

Package invoker constructs a grpc request and executes it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Invoker

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

Invoker invokes grpc methods.

func New

func New(svc service.Method, opts ...Option) *Invoker

New creates a new Invoker.

func (*Invoker) Invoke

func (i *Invoker) Invoke(ctx context.Context) error

Invoke invokes the grpc method.

func (*Invoker) WithInvokeOption

func (i *Invoker) WithInvokeOption(o grpcmock.InvokeOption) *Invoker

WithInvokeOption adds a new invoke option. nolint: unparam

func (*Invoker) WithTimeout

func (i *Invoker) WithTimeout(d time.Duration) *Invoker

WithTimeout sets timeout.

type Option

type Option func(i *Invoker)

Option sets up the invoker.

func WithAddress

func WithAddress(addr string) Option

WithAddress sets server address.

func WithBidirectionalStreamHandler

func WithBidirectionalStreamHandler(h grpcmock.ClientStreamHandler) Option

WithBidirectionalStreamHandler sets the bidirectional stream handler for the invoker.

func WithBufConnDialer

func WithBufConnDialer(l *bufconn.Listener) Option

WithBufConnDialer sets grpcmock.BufConnDialer option.

func WithCallOptions

func WithCallOptions(opts ...grpc.CallOption) Option

WithCallOptions sets grpcmock.CallOptions option.

func WithContextDialer

func WithContextDialer(d grpcmock.ContextDialer) Option

WithContextDialer sets grpcmock.ContextDialer option.

func WithDialOptions

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

WithDialOptions sets grpcmock.DialOptions option.

func WithHeader

func WithHeader(key, value string) Option

WithHeader sets grpcmock.Header option.

func WithHeaders

func WithHeaders(header map[string]string) Option

WithHeaders sets grpcmock.Headers option.

func WithInput

func WithInput(input interface{}) Option

WithInput sets the input for the invoker.

func WithInputStreamHandler

func WithInputStreamHandler(h grpcmock.ClientStreamHandler) Option

WithInputStreamHandler sets the input stream handler for the invoker.

func WithInsecure

func WithInsecure() Option

WithInsecure sets grpcmock.Insecure option.

func WithOutput

func WithOutput(output interface{}) Option

WithOutput sets the output for the invoker.

func WithOutputStreamHandler

func WithOutputStreamHandler(h grpcmock.ClientStreamHandler) Option

WithOutputStreamHandler sets the output stream handler for the invoker.

func WithTimeout

func WithTimeout(d time.Duration) Option

WithTimeout sets timeout.

Jump to

Keyboard shortcuts

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