a2r

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Call

func Call[A, B, C any](rpc func(client C, ctx context.Context, req *A, options ...grpc.CallOption) (*B, error), client C, c *gin.Context, opts ...*Option[A, B])

func ParseRequest

func ParseRequest[T any](c *gin.Context) (*T, error)

func ParseRequestNotCheck

func ParseRequestNotCheck[T any](c *gin.Context) (*T, error)

Types

type Option

type Option[A, B any] struct {
	// BindAfter is called after the req is bind from ctx.
	BindAfter func(*A) error
	// RespAfter is called after the resp is return from rpc.
	RespAfter func(*B) error
}

func NewNilReplaceOption added in v1.1.0

func NewNilReplaceOption[A, B, C any](_ func(client C, ctx context.Context, req *A, options ...grpc.CallOption) (*B, error)) *Option[A, B]

Jump to

Keyboard shortcuts

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