routes

package
v0.0.0-...-58c3220 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxSize                 = 500
	FirstPage               = 0
	SizeURLParamName        = "size"
	PageURLParamName        = "page"
	DisabledAPIErrorMessage = "This API is disabled"
)
View Source
const (
	HealthCheckURL = "/health"
)

Variables

This section is empty.

Functions

func DisableAPIMiddleware

func DisableAPIMiddleware(enabledAPI bool) gin.HandlerFunc

func GetTimeNowTruncatedToSeconds

func GetTimeNowTruncatedToSeconds() metav1.Time

Because k8s has only "seconds" precision therefore we should operate the same precision in tests to compare timings in appropriate way

func SetUpHealthCheck

func SetUpHealthCheck(server *gin.Engine)

func SetUpPrometheus

func SetUpPrometheus(server *gin.Engine)

func SetUpSwagger

func SetUpSwagger(rg *gin.RouterGroup, apiStaticFS http.FileSystem)

func URLParamsToFilter

func URLParamsToFilter(c *gin.Context, filter interface{}, fields map[string]int) (size int, page int, err error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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