Documentation ¶
Index ¶
- func GoValToProtoStruct(v interface{}) (*structpb.Value, error)
- func ProtoStructToGoVal(v *structpb.Value, into interface{}) error
- func ReadJSON(r *http.Request, into any) error
- func WriteErr(w http.ResponseWriter, err error)
- func WriteJSON(w http.ResponseWriter, status int, v interface{})
- type ListResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GoValToProtoStruct ¶ added in v0.2.1
func ProtoStructToGoVal ¶ added in v0.2.1
func WriteErr ¶
func WriteErr(w http.ResponseWriter, err error)
WriteErr interprets the given error as one of the errors defined in errors package and writes the error response.
func WriteJSON ¶
func WriteJSON(w http.ResponseWriter, status int, v interface{})
WriteJSON writes 'v' to response-writer in JSON format.
Types ¶
type ListResponse ¶ added in v0.2.1
type ListResponse[T any] struct { Items []T `json:"items"` }
ListResponse can be used to write list of items to response. This format is helpful in enabling pagination.
Click to show internal directories.
Click to hide internal directories.