middleware

package
v0.0.0-...-0bdedc6 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Auth

func Auth(adminKey string) macaron.Handler

func GetContextHandler

func GetContextHandler() macaron.Handler

func GetUser

func GetUser(adminKey, key string) (*auth.User, error)

func Init

func Init(adminKey string)

func Quota

func Quota(target string) macaron.Handler

func QuotaReached

func QuotaReached(c *Context, target string) (bool, error)

func RequestStats

func RequestStats(handler string) macaron.Handler

RequestStats returns a middleware that tracks request metrics.

func RequireAdmin

func RequireAdmin() macaron.Handler

func RoleAuth

func RoleAuth(roles ...gcom.RoleType) macaron.Handler

Types

type Context

type Context struct {
	*macaron.Context
	*auth.User
	ApiKey string
}

Jump to

Keyboard shortcuts

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