responses

package
v0.0.0-...-e8bea81 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrBadRequest         = "Bad request"
	ErrEmailAlreadyExists = "User with given email already exists"
	ErrNoSuchUser         = "User not found"
	ErrWrongCredentials   = "Wrong Credentials"
	ErrNotFound           = "Not Found"
	ErrUnauthorized       = "Unauthorized"
	ErrForbidden          = "Forbidden"
	ErrBadQueryParams     = "Invalid query params"
)

Variables

This section is empty.

Functions

func ErrorResponse

func ErrorResponse(err error) (int, interface{})

func SuccessResponse

func SuccessResponse(data interface{}) interface{}

Types

type APIError

type APIError struct {
	Status int         `json:"code"`
	Error  interface{} `json:"error"`
}

type Response

type Response struct {
	Status string             `json:"status"`
	Data   interface{}        `json:"data,omitempty"`
	Error  httpErrors.RestErr `json:"error,omitempty"`
}

Jump to

Keyboard shortcuts

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