webapi

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2024 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(apiRouterGroup *gin.RouterGroup) error

Init initializes the webapi and makes it ready to be used.

func RespondWithError added in v0.4.0

func RespondWithError(g *gin.Context, error ErrorResponse)

RespondWithError responds to a request with the passed error. Any further processing will be aborted!

func Router

func Router() *gin.RouterGroup

Router returns the root gin.RouterGroup that should be used to register new router groups and routes.

This function should be used by components to create API endpoints.

Types

type ErrorResponse added in v0.4.0

type ErrorResponse struct {
	Status    int       `json:"status"`
	Error     string    `json:"error"`
	Message   string    `json:"message"`
	Timestamp time.Time `json:"timestamp"`

} //@Name Error

ErrorResponse is an error that can be thrown on the web api.

@Description Error holds information about an error that occurred.

Jump to

Keyboard shortcuts

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