server

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2022 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorHandler

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

func RegisterHandler

func RegisterHandler(action func(ctx *fiber.Ctx) error)

func Use

func Use(action func(ctx *fiber.Ctx) error) func(ctx *fiber.Ctx) error

Types

type App

type App struct {
	*fiber.App
	// contains filtered or unexported fields
}

func New

func New(config ...Config) *App

func (*App) Start

func (app *App) Start(addr string) error

type Config

type Config struct {
	Recovery  bool
	Swagger   bool
	RequestID bool
	Logger    bool
}

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

Jump to

Keyboard shortcuts

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