Documentation
¶
Index ¶
- func AttachRoutes(co controllers.Controller, group *gin.RouterGroup)
- func Config(url *url.URL) (*gin.Engine, func(), error)
- func GetRoot(c *gin.Context)
- func GetV3(c *gin.Context)
- func GetVersion(c *gin.Context)
- func MetricsMiddleware() gin.HandlerFunc
- func OptionsRoot(c *gin.Context)
- func OptionsV3(c *gin.Context)
- func OptionsVersion(c *gin.Context)
- func URLMiddleware(url *url.URL) gin.HandlerFunc
- type RootLinks
- type RootResponse
- type V3Links
- type V3Response
- type VersionObject
- type VersionResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AttachRoutes ¶
func AttachRoutes(co controllers.Controller, group *gin.RouterGroup)
AttachRoutes attaches the API routes to the router group that is passed in Separating this from RouterConfig() allows us to attach it to different paths for different use cases, e.g. the standalone version.
func GetRoot ¶
GetRoot returns the link list for the API root
@Summary API root
@Description Entrypoint for the API, listing all endpoints
@Tags General
@Success 200 {object} RootResponse
@Router / [get]
func GetV3 ¶
GetV3 returns the link list for v3
@Summary v3 API
@Description Returns general information about the v3 API
@Tags v3
@Success 200 {object} V3Response
@Router /v3 [get]
func GetVersion ¶
GetVersion returns the API version object
@Summary API version
@Description Returns the software version of the API
@Tags General
@Success 200 {object} VersionResponse
@Router /version [get]
func MetricsMiddleware ¶
func MetricsMiddleware() gin.HandlerFunc
MetricsMiddleware updates Prometheus metrics.
func OptionsRoot ¶
OptionsRoot returns the allowed HTTP methods
@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 OptionsV3 ¶
OptionsV3 returns the allowed HTTP methods
@Summary Allowed HTTP verbs @Description Returns an empty response with the HTTP Header "allow" set to the allowed HTTP verbs @Tags v3 @Success 204 @Router /v3 [options]
func OptionsVersion ¶
OptionsVersion returns the allowed HTTP methods
@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 URLMiddleware ¶
func URLMiddleware(url *url.URL) gin.HandlerFunc
Types ¶
type RootLinks ¶
type RootLinks struct {
Docs string `json:"docs" example:"https://example.com/api/docs/index.html"` // Swagger API documentation
Healthz string `json:"healthz" example:"https://example.com/api/healtzh"` // Healthz endpoint
Version string `json:"version" example:"https://example.com/api/version"` // Endpoint returning the version of the backend
Metrics string `json:"metrics" example:"https://example.com/api/metrics"` // Endpoint returning Prometheus metrics
V3 string `json:"v3" example:"https://example.com/api/v3"` // List endpoint for all v3 endpoints
}
type RootResponse ¶
type RootResponse struct {
Links RootLinks `json:"links"` // URLs of API endpoints
}
type V3Links ¶
type V3Links struct {
Accounts string `json:"accounts" example:"https://example.com/api/v3/accounts"` // URL of Account collection endpoint
Budgets string `json:"budgets" example:"https://example.com/api/v3/budgets"` // URL of Budget collection endpoint
Categories string `json:"categories" example:"https://example.com/api/v3/categories"` // URL of Category collection endpoint
Envelopes string `json:"envelopes" example:"https://example.com/api/v3/envelopes"` // URL of Envelope collection endpoint
Goals string `json:"goals" example:"https://example.com/api/v3/goals"` // URL of goal collection endpoint
Import string `json:"import" example:"https://example.com/api/v3/import"` // URL of import list endpoint
MatchRules string `json:"matchRules" example:"https://example.com/api/v3/match-rules"` // URL of Match Rule collection endpoint
Months string `json:"months" example:"https://example.com/api/v3/months"` // URL of Month endpoint
Transactions string `json:"transactions" example:"https://example.com/api/v3/transactions"` // URL of Transaction collection endpoint
}
type V3Response ¶
type V3Response struct {
Links V3Links `json:"links"` // Links for the v3 API
}
type VersionObject ¶
type VersionObject struct {
Version string `json:"version" example:"1.1.0"` // the running version of the Envelope Zero backend
}
type VersionResponse ¶
type VersionResponse struct {
Data VersionObject `json:"data"` // Data object for the version endpoint
}
Click to show internal directories.
Click to hide internal directories.