common

package
v0.0.0-...-1c246ab Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2024 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SuccessStatus        = "SUCCESS"
	UnauthorizedStatus   = "UNAUTHORIZED"
	ValidationErrStatus  = "VALIDATION_ERROR"
	BadRequestStatus     = "BAD_REQUEST"
	ForbiddenStatus      = "FORBIDDEN"
	InternalErrStatus    = "SERVER_ERROR"
	NotFoundStatus       = "NOT_FOUND"
	NotAcceptableStatus  = "NOT_ACCEPTABLE"
	TooEarlyStatus       = "TOO_EARLY"
	TooManyRequestStatus = "TOO_MANY_REQUEST"
	DuplicateStatus      = "DUPLICATE"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultResponse

type DefaultResponse struct {
	Code    int    `json:"code"`
	Status  string `json:"status,omitempty"`
	Message string `json:"message"`
}

DefaultResponse default payload response

func NewDefaultCreatedResponse

func NewDefaultCreatedResponse() DefaultResponse

NewDefaultSuccessResponse default validation error response

func NewDefaultSuccessResponse

func NewDefaultSuccessResponse() DefaultResponse

NewDefaultSuccessResponse default validation error response

func NewForbiddenResponse

func NewForbiddenResponse(msg string) DefaultResponse

NewUnauthorizedResponse default unauthorized response

func NewUnauthorizedResponse

func NewUnauthorizedResponse(msg string) DefaultResponse

NewUnauthorizedResponse default unauthorized response

func NewValidationErrorResponse

func NewValidationErrorResponse(message string) DefaultResponse

NewValidationErrorResponse default validation error response

type ErrorResponse

type ErrorResponse struct {
	Code     int    `json:"code"`
	Status   string `json:"status,omitempty"`
	Message  string `json:"message"`
	Internal error  `json:"-"`
}

ErrorResponse error response

Directories

Path Synopsis
middleware

Jump to

Keyboard shortcuts

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