api

package
v0.0.0-...-6b69eb2 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ENV     = "ENV"
	VERSION = "VERSION"
)

Variables

View Source
var (
	IsProduction bool
	Version      string = ""
)

Functions

func ErrorHandlerThrow

func ErrorHandlerThrow(c *fiber.Ctx, code int, err error) error

func ErrorNotImplemented

func ErrorNotImplemented(c *fiber.Ctx) error

func ErrorUnauthorized

func ErrorUnauthorized(c *fiber.Ctx, err error) error

func FiberListen

func FiberListen(app *fiber.App, port string)

func GetUserAgent

func GetUserAgent(c *fiber.Ctx) ua.UserAgent

func HanderMiddlewareSecurity

func HanderMiddlewareSecurity(c *fiber.Ctx) error

func HandlerHealth

func HandlerHealth(c *fiber.Ctx) error

func ThrowInternalServerError

func ThrowInternalServerError(c *fiber.Ctx, err error) error

Types

type HTTP

type HTTP struct {
	Code  int    `json:"code,omitempty"`
	Error string `json:"error,omitempty"`
}

func HttpErrorPrint

func HttpErrorPrint(code int, format string, v ...any) *HTTP

func HttpErrorPrintf

func HttpErrorPrintf(code int, v ...any) *HTTP

func HttpErrorf

func HttpErrorf(code int, err error) *HTTP

type IPAddr

type IPAddr struct {
	Value   string
	IsLocal bool
}

func GetConnectingIP

func GetConnectingIP(c *fiber.Ctx, realIP bool) *IPAddr

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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