response

package
v1.1.0-beta Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorAttribute

type ErrorAttribute struct {
	Name    string `json:"name"`
	Message string `json:"message"`
}

type ErrorSchema

type ErrorSchema struct {
	Code    string `json:"code"`
	Message string `json:"message"`
}

type HTTPErrorResponse

type HTTPErrorResponse struct {
	Error ErrorSchema `json:"error"`
}

func NewAuthorizationError

func NewAuthorizationError() HTTPErrorResponse

func NewBodyParserErrorResponse

func NewBodyParserErrorResponse() HTTPErrorResponse

func NewErrorResponse

func NewErrorResponse(ctx context.Context, err error, msg ...string) HTTPErrorResponse

type HTTPSuccessResponse

type HTTPSuccessResponse struct {
	Data interface{} `json:"data"`
}

func NewSuccessResponse

func NewSuccessResponse(data interface{}) HTTPSuccessResponse

type HTTPValidationErrorResponse

type HTTPValidationErrorResponse struct {
	Error      ErrorSchema      `json:"error"`
	Attributes []ErrorAttribute `json:"attributes"`
}

func NewValidationErrorResponse

func NewValidationErrorResponse(errors map[string]string) HTTPValidationErrorResponse

Jump to

Keyboard shortcuts

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