response

package
v0.0.0-...-3beaeaf Latest Latest
Warning

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

Go to latest
Published: May 27, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RenderErr

func RenderErr(ctx *gin.Context, e *Err)

Types

type Err

type Err struct {
	ErrorCode int    `json:"error_code,omitempty"` // application-specific error code
	ErrorMsg  string `json:"error"`                // user-facing error message
	// contains filtered or unexported fields
}

func ErrBadRequest

func ErrBadRequest(err error) *Err

func ErrInternalServerError

func ErrInternalServerError(err error) *Err

func ErrInvalidInput

func ErrInvalidInput(fieldName string, fieldValue any) *Err

func ErrJWTUnverified

func ErrJWTUnverified(err error) *Err

func ErrNotFound

func ErrNotFound(resourceName, fieldName string, fieldValue any) *Err

func ErrPermissionDenied

func ErrPermissionDenied(err error) *Err

func ErrWrongCredentials

func ErrWrongCredentials(err error) *Err

type LoginResponse

type LoginResponse struct {
	Token string      `json:"token"`
	User  domain.User `json:"user"`
}

Jump to

Keyboard shortcuts

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