Documentation
¶
Index ¶
- func Error(c http.Context, opts ...StdOpt) http.Response
- func Resp(c http.Context, code, desc string, opts ...StdOpt) http.Response
- func Success(c http.Context, opts ...StdOpt) http.Response
- type Std
- type StdOpt
- func WithData(data any) StdOpt
- func WithDesc(desc string) StdOpt
- func WithErr(e error) StdOpt
- func WithErrAccess(e error) StdOpt
- func WithErrHeader(e error) StdOpt
- func WithErrInvalidRule(e error) StdOpt
- func WithErrNotFound(e error) StdOpt
- func WithErrParameter(e error) StdOpt
- func WithErrRuntime(e error) StdOpt
- func WithErrThirdParty(e error) StdOpt
- func WithErrUnsupport(e error) StdOpt
- func WithErrWaiting(e error) StdOpt
- func WithMaskedData(keysToMask []string, data any) StdOpt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Error ¶
Error construct standard response with default error response code and description after applying any given options.
Types ¶
type Std ¶
type Std struct {
ResponseCode string `json:"responseCode"`
ResponseDesc string `json:"responseDesc"`
ResponseData any `json:"responseData,omitempty"`
ResponseValidation []string `json:"responseValidation,omitempty"`
// contains filtered or unexported fields
}
Std holds standard response structure for brispot microservice.
type StdOpt ¶
type StdOpt func(std *Std)
StdOpt option signature that accept and modify Std response object.
func WithErrAccess ¶
func WithErrHeader ¶
func WithErrInvalidRule ¶
func WithErrNotFound ¶
func WithErrParameter ¶
func WithErrRuntime ¶
func WithErrThirdParty ¶
func WithErrUnsupport ¶
func WithErrWaiting ¶
func WithMaskedData ¶
WithMaskedData masks specified keys in the response data
Click to show internal directories.
Click to hide internal directories.