rpccall

package
v0.0.72-alpha.66 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: Apache-2.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractField

func ExtractField[A, B, C any](ctx context.Context, fn func(ctx context.Context, req *A, opts ...grpc.CallOption) (*B, error), req *A, get func(*B) C, opts ...grpc.CallOption) (C, error)

ExtractField is a generic function that extracts a field from the response of a given function.

func Page

func Page[Req pagination, Resp any, Elem any](ctx context.Context, req Req, api func(ctx context.Context, req Req, opts ...grpc.CallOption) (*Resp, error), fn func(*Resp) []Elem, opts ...grpc.CallOption) ([]Elem, error)

Types

type RpcCaller

type RpcCaller[Req, Resp any] struct {
	// contains filtered or unexported fields
}

func NewRpcCaller

func NewRpcCaller[Req, Resp any](name string) *RpcCaller[Req, Resp]

func (*RpcCaller[Req, Resp]) Execute

func (r *RpcCaller[Req, Resp]) Execute(ctx context.Context, req *Req, opts ...grpc.CallOption) error

func (*RpcCaller[Req, Resp]) Invoke

func (r *RpcCaller[Req, Resp]) Invoke(ctx context.Context, in *Req, opts ...grpc.CallOption) (*Resp, error)

func (*RpcCaller[Req, Resp]) MethodName

func (r *RpcCaller[Req, Resp]) MethodName() string

func (*RpcCaller[Req, Resp]) SetConn

func (r *RpcCaller[Req, Resp]) SetConn(conn *grpc.ClientConn)

Jump to

Keyboard shortcuts

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