mrresponse

package
v0.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 30, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrorAttributeIDByDefault = "generalError"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorAttribute

type ErrorAttribute struct {
	ID        string `json:"id"`
	Value     string `json:"value"`
	DebugInfo string `json:"debugInfo,omitempty"`
}

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) SendFile

func (rs *FileSender) SendFile(w http.ResponseWriter, info mrtype.FileInfo, attachmentName string, file io.Reader) error

type Sender

type Sender struct {
	// contains filtered or unexported fields
}

func NewSender

func NewSender(encoder mrserver.ResponseEncoder) *Sender

func (*Sender) Send

func (rs *Sender) Send(w http.ResponseWriter, status int, structure any) error

func (*Sender) SendNoContent

func (rs *Sender) SendNoContent(w http.ResponseWriter) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL