Documentation ¶
Index ¶
- Constants
- func HandlerGetMethodNotAllowedAsJson() func(w http.ResponseWriter, r *http.Request)
- func HandlerGetNotFoundAsJson() func(w http.ResponseWriter, r *http.Request)
- func HandlerGetSystemInfoAsJson(cfg SystemInfoConfig) (func(w http.ResponseWriter, r *http.Request), error)
- type ErrorAttribute
- type ErrorDetailsResponse
- type ErrorListResponse
- type ErrorSender
- type FileSender
- type Sender
- type SuccessCreatedItemResponse
- type SuccessModifyItemResponse
- type SystemInfoConfig
Constants ¶
View Source
const (
ErrorAttributeIDByDefault = "generalError"
)
Variables ¶
This section is empty.
Functions ¶
func HandlerGetMethodNotAllowedAsJson ¶ added in v0.14.0
func HandlerGetMethodNotAllowedAsJson() func(w http.ResponseWriter, r *http.Request)
func HandlerGetNotFoundAsJson ¶ added in v0.14.0
func HandlerGetNotFoundAsJson() func(w http.ResponseWriter, r *http.Request)
func HandlerGetSystemInfoAsJson ¶ added in v0.14.0
func HandlerGetSystemInfoAsJson(cfg SystemInfoConfig) (func(w http.ResponseWriter, r *http.Request), error)
Types ¶
type ErrorAttribute ¶
type ErrorDetailsResponse ¶
type ErrorDetailsResponse struct { Title string `json:"title"` Details string `json:"details"` Request string `json:"request"` Time string `json:"time"` ErrorTraceID string `json:"errorTraceId,omitempty"` }
ErrorDetailsResponse - application/problem+json (401, 403, 404, 418, 5XX)
type ErrorListResponse ¶
type ErrorListResponse []ErrorAttribute
ErrorListResponse - application/json (400)
type ErrorSender ¶
type ErrorSender struct {
// contains filtered or unexported fields
}
func NewErrorSender ¶
func NewErrorSender(encoder mrserver.ResponseEncoder) *ErrorSender
func NewErrorSenderWithOverrideFunc ¶
func NewErrorSenderWithOverrideFunc( encoder mrserver.ResponseEncoder, overrideFunc mrserver.HttpErrorOverrideFunc, ) *ErrorSender
func (*ErrorSender) SendError ¶
func (rs *ErrorSender) SendError(w http.ResponseWriter, r *http.Request, err error)
type FileSender ¶
type FileSender struct {
*Sender
}
func NewFileSender ¶
func NewFileSender(base *Sender) *FileSender
func (*FileSender) SendAttachmentFile ¶ added in v0.14.0
func (rs *FileSender) SendAttachmentFile(ctx context.Context, w http.ResponseWriter, file mrtype.File) error
func (*FileSender) SendFile ¶
func (rs *FileSender) SendFile(ctx context.Context, w http.ResponseWriter, file mrtype.File) error
type Sender ¶
type Sender struct {
// contains filtered or unexported fields
}
func NewSender ¶
func NewSender(encoder mrserver.ResponseEncoder) *Sender
func (*Sender) SendNoContent ¶
func (rs *Sender) SendNoContent(w http.ResponseWriter) error
type SuccessCreatedItemResponse ¶ added in v0.14.0
type SuccessModifyItemResponse ¶ added in v0.14.0
type SuccessModifyItemResponse struct {
Message string `json:"message,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.