7 // DecodeRequestFunc extracts a user-domain request object from a gRPC request.
8 // It's designed to be used in gRPC servers, for server-side endpoints. One
9 // straightforward DecodeRequestFunc could be something that decodes from the
10 // gRPC request message to the concrete request type.
11 type DecodeRequestFunc func(context.Context, interface{}) (request interface{}, err error)
13 // EncodeRequestFunc encodes the passed request object into the gRPC request
14 // object. It's designed to be used in gRPC clients, for client-side endpoints.
15 // One straightforward EncodeRequestFunc could something that encodes the object
16 // directly to the gRPC request message.
17 type EncodeRequestFunc func(context.Context, interface{}) (request interface{}, err error)
19 // EncodeResponseFunc encodes the passed response object to the gRPC response
20 // message. It's designed to be used in gRPC servers, for server-side endpoints.
21 // One straightforward EncodeResponseFunc could be something that encodes the
22 // object directly to the gRPC response message.
23 type EncodeResponseFunc func(context.Context, interface{}) (response interface{}, err error)
25 // DecodeResponseFunc extracts a user-domain response object from a gRPC
26 // response object. It's designed to be used in gRPC clients, for client-side
27 // endpoints. One straightforward DecodeResponseFunc could be something that
28 // decodes from the gRPC response message to the concrete response type.
29 type DecodeResponseFunc func(context.Context, interface{}) (response interface{}, err error)