router

package
v0.44.1 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2022 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRoot

func GetRoot(c *gin.Context)

@Summary API root @Description Entrypoint for the API, listing all endpoints @Tags General @Success 200 {object} RootResponse @Router / [get]

func GetV1

func GetV1(c *gin.Context)

@Summary v1 API @Description Returns general information about the v1 API @Tags v1 @Success 200 {object} V1Response @Router /v1 [get]

func GetVersion

func GetVersion(c *gin.Context)

@Summary API version @Description Returns the software version of the API @Tags General @Success 200 {object} VersionResponse @Router /version [get]

func OptionsRoot

func OptionsRoot(c *gin.Context)

@Summary Allowed HTTP verbs @Description Returns an empty response with the HTTP Header "allow" set to the allowed HTTP verbs @Tags General @Success 204 @Router / [options]

func OptionsV1

func OptionsV1(c *gin.Context)

@Summary Allowed HTTP verbs @Description Returns an empty response with the HTTP Header "allow" set to the allowed HTTP verbs @Tags v1 @Success 204 @Router /v1 [options]

func OptionsVersion

func OptionsVersion(c *gin.Context)

@Summary Allowed HTTP verbs @Description Returns an empty response with the HTTP Header "allow" set to the allowed HTTP verbs @Tags General @Success 204 @Router /version [options]

func Router

func Router() (*gin.Engine, error)

Router controls the routes for the API.

func URLMiddleware added in v0.31.0

func URLMiddleware() gin.HandlerFunc

Types

type RootLinks struct {
	Docs    string `json:"docs" example:"https://example.com/api/docs/index.html"`
	Version string `json:"version" example:"https://example.com/api/version"`
	V1      string `json:"v1" example:"https://example.com/api/v1"`
}

type RootResponse

type RootResponse struct {
	Links RootLinks `json:"links"`
}
type V1Links struct {
	Budgets      string `json:"budgets" example:"https://example.com/api/v1/budgets"`
	Accounts     string `json:"accounts" example:"https://example.com/api/v1/accounts"`
	Categories   string `json:"categories" example:"https://example.com/api/v1/categories"`
	Transactions string `json:"transactions" example:"https://example.com/api/v1/transactions"`
	Envelopes    string `json:"envelopes" example:"https://example.com/api/v1/envelopes"`
	Allocations  string `json:"allocations" example:"https://example.com/api/v1/allocations"`
}

type V1Response

type V1Response struct {
	Links V1Links `json:"links"`
}

type VersionObject

type VersionObject struct {
	Version string `json:"version" example:"1.1.0"`
}

type VersionResponse

type VersionResponse struct {
	Data VersionObject `json:"data"`
}

Jump to

Keyboard shortcuts

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