api

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorHandler

func ErrorHandler(ctx *fiber.Ctx, err error) error

Types

type App

type App struct {
	*fiber.App
}

type Application

type Application struct {
	UseRecovery  bool
	UseRequestID bool
	UseLogger    bool
	UseSwagger   bool

	FiberApp App // for fine-tuning
	// contains filtered or unexported fields
}

func (*Application) Build

func (a *Application) Build() *App

func (*Application) Register

func (a *Application) Register(verb string, path string, action func(context *Context) error) *Application

func (*Application) Start

func (a *Application) Start(addr string) error

type Context

type Context struct {
	*fiber.Ctx
}

type Error

type Error struct {
	StatusCode int    `json:"status_code,omitempty"`
	Message    string `json:"message,omitempty"`
}

func NewError

func NewError(statusCode int, message string) *Error

func (Error) Error

func (e Error) Error() string

type Route

type Route struct {
	Path   string
	Verb   string
	Action func(context *Context) error
}

Jump to

Keyboard shortcuts

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