webserver

package
v0.7.18 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2025 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CONTENT_TYPE      = "Content-Type"
	CONTENT_TYPE_JSON = "application/json"
	AUTHORIZATION     = "Authorization"
)

Variables

View Source
var ErrIncorrectContentType = fmt.Errorf(
	"http header did not contain key %s with value %s",
	CONTENT_TYPE,
	CONTENT_TYPE_JSON,
)

Functions

func ErrorResponse

func ErrorResponse(c *fiber.Ctx, message string, httpStatusCode int) error

func GetAuthHeader

func GetAuthHeader(c *fiber.Ctx) (header string)

func UnmarshalBody

func UnmarshalBody[bodyT any](c *fiber.Ctx) (v bodyT, err error)

Types

type Server

type Server interface {
	Base() fiber.Router
	API() fiber.Router
	Run()
	RunIP(ip string)
	Shutdown()
	Port() uint16
	Url() (u *url.URL)
}

func Init

func Init(port uint16, fromBase bool) (Server, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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