You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Open-IM-Server/internal/a2r/api2rpc.go

29 lines
585 B

2 years ago
package a2r
import (
"context"
"github.com/gin-gonic/gin"
"google.golang.org/grpc"
)
// Call TEST
func Call[A, B, C, D, E any](
apiReq *A,
apiResp *B,
rpc func(client E, ctx context.Context, req C, options ...grpc.CallOption) (D, error),
client func() (E, error),
c *gin.Context,
before func(apiReq *A, rpcReq *C, bind func() error) error,
after func(rpcResp *D, apiResp *B, bind func() error) error,
) {
}
func Call1[C, D, E any](
rpc func(client E, ctx context.Context, req C, options ...grpc.CallOption) (D, error),
client func() (E, error),
c *gin.Context,
) {
}