webserver

package
v0.18.8 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2024 License: MIT Imports: 14 Imported by: 5

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 added in v0.4.2

func ErrorResponse(c *gin.Context, message string, httpStatusCode int)

func GetAuthHeader added in v0.4.2

func GetAuthHeader(c *gin.Context) (header string)

func UnmarshalBody added in v0.4.2

func UnmarshalBody[bodyT any](c *gin.Context) (v bodyT, err error)

Types

type Server

type Server interface {
	Base() *gin.RouterGroup
	API() *gin.RouterGroup
	Run()
	Port() uint16
	Url() (u *url.URL)
}

func Init

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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