middleware

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2016 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllowCORS

func AllowCORS() martini.Handler

func Auth

func Auth(user_storage storage.UserStorage) martini.Handler

func CombinedLogger

func CombinedLogger() martini.Handler

func EncodeOutput

func EncodeOutput(prettify bool) martini.Handler

func LogrusLogger added in v0.6.7

func LogrusLogger() martini.Handler

func RequireAdmin added in v0.6.6

func RequireAdmin() martini.Handler

func RequireRoles

func RequireRoles(roles ...dsapid.UserRoleName) martini.Handler

func Throttle added in v0.7.1

func Throttle(quota *throttle.Quota) martini.Handler

Types

type OutputEncoder

type OutputEncoder interface {
	Encode(v ...interface{}) ([]byte, error)
	MustEncode(v ...interface{}) []byte
}

type User

type User interface {
	GetId() string
	GetName() string
	HasRoles(...dsapid.UserRoleName) bool
	IsGuest() bool
	GetAuthInfo() interface{}
}

Jump to

Keyboard shortcuts

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