mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-14 22:15:59 +08:00
api to rpc
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
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,
|
||||
) {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user