router

package
v0.0.0-...-633eb4a Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Router

type Router struct {
	Engine   *gin.Engine
	Cached   *gin.RouterGroup
	Uncached *gin.RouterGroup
}

Router contains bindings for gin's router engine

func NewRouter

func NewRouter() *Router

NewRouter returns nikel-core's base router

func (*Router) SetAllowCors

func (r *Router) SetAllowCors() *Router

SetAllowCors allows all origins

func (*Router) SetGzip

func (r *Router) SetGzip() *Router

SetGzip gzips all api responses

func (*Router) SetLevelDBCache

func (r *Router) SetLevelDBCache(expires ...time.Duration) *Router

SetLevelDBCache sets a LevelDB backed cache

func (*Router) SetRateLimiter

func (r *Router) SetRateLimiter(opt ...int) *Router

SetRateLimiter sets the rate limiter

func (*Router) SetRoutes

func (r *Router) SetRoutes() *Router

SetRoutes sets the routes

Jump to

Keyboard shortcuts

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