common

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ApiV1      = "/api/v1"
	AuthV1     = ApiV1 + "/auth"
	DrinksV1   = ApiV1 + "/drinks"
	HealthV1   = ApiV1 + "/health"
	SettingsV1 = ApiV1 + "/settings"
	UserV1     = ApiV1 + "/users"
)

Variables

View Source
var ErrNotFound = errors.New("not found")

Functions

func DefaultedEnvVar

func DefaultedEnvVar(key string, defaultVal string) string

func ErrorHandler added in v0.6.0

func ErrorHandler(c *fiber.Ctx, e error) error

func NewApp added in v0.6.0

func NewApp() *fiber.App

Types

type ErrorResponse added in v0.6.0

type ErrorResponse struct {
	Msg     string
	Err     error
	Context string
	Status  int
}

func NewBadRequestResponse added in v0.6.0

func NewBadRequestResponse(e error) ErrorResponse

func NewGenericNotFoundResponse added in v0.6.0

func NewGenericNotFoundResponse(context string) ErrorResponse

func NewGenericUnauthorizedResponse added in v0.6.0

func NewGenericUnauthorizedResponse(context string) ErrorResponse

func NewInternalServerErrorResp added in v0.6.0

func NewInternalServerErrorResp(context string, e error) ErrorResponse

func (ErrorResponse) Error added in v0.6.0

func (e ErrorResponse) Error() string

type FiberHandler added in v0.5.0

type FiberHandler func(*fiber.Ctx) error

type HttpHandler

type HttpHandler func(http.ResponseWriter, *http.Request)

type OutboundErrResponse added in v0.6.0

type OutboundErrResponse struct {
	Error   string `json:"error"`
	Success bool   `json:"success"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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