Documentation
¶
Index ¶
- func ExtractField[A, B, C any](ctx context.Context, ...) (C, error)
- func Page[Req pagination, Resp any, Elem any](ctx context.Context, req Req, ...) ([]Elem, error)
- type RpcCaller
- func (r RpcCaller[Req, Resp]) Execute(ctx context.Context, req *Req, opts ...grpc.CallOption) error
- func (r RpcCaller[Req, Resp]) Invoke(ctx context.Context, in *Req, opts ...grpc.CallOption) (*Resp, error)
- func (r RpcCaller[Req, Resp]) MethodName() string
- func (r RpcCaller[Req, Resp]) SetConn(conn *grpc.ClientConn)
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.
Types ¶
type RpcCaller ¶
type RpcCaller[Req, Resp any] struct { // contains filtered or unexported fields }
func NewRpcCaller ¶
func (RpcCaller[Req, Resp]) MethodName ¶
func (RpcCaller[Req, Resp]) SetConn ¶
func (r RpcCaller[Req, Resp]) SetConn(conn *grpc.ClientConn)
Click to show internal directories.
Click to hide internal directories.