middleware

package
v0.0.0-...-f4df827 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2017 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTokenScopeDomain

func GetTokenScopeDomain(c *gin.Context) *v1.Project

func GetTokenScopeProject

func GetTokenScopeProject(c *gin.Context) *v1.Project

func GetTokenSubjectUser

func GetTokenSubjectUser(c *gin.Context) *v1.User

func RequiredTokenScopeDomain

func RequiredTokenScopeDomain(c *gin.Context) *v1.Project

func RequiredTokenScopeProject

func RequiredTokenScopeProject(c *gin.Context) *v1.Project

func RequiredTokenSubjectUser

func RequiredTokenSubjectUser(c *gin.Context) *v1.User

Types

type MicroVersion

type MicroVersion struct {
	Major int
	Micro int
}

func GetMicroVersion

func GetMicroVersion(c *gin.Context) *MicroVersion

func ParseMicroVersion

func ParseMicroVersion(ver string) *MicroVersion

func (*MicroVersion) InRange

func (ver *MicroVersion) InRange(min, max *MicroVersion) bool

func (*MicroVersion) String

func (ver *MicroVersion) String() string

type MicroVersionErrorInfo

type MicroVersionErrorInfo struct {
	RequestID  string          `json:"request_id"`
	Code       string          `json:"code"`
	Status     uint            `json:"status"`
	Title      string          `json:"title"`
	Detail     string          `json:"detail"`
	MaxVersion string          `json:"max_version"`
	MinVersion string          `json:"min_version"`
	Links      []rest.LinkInfo `json:"links"`
}

type MicroVersionErrorRes

type MicroVersionErrorRes struct {
	Errors []MicroVersionErrorInfo `json:"errors"`
}

type Middleware

type Middleware interface {
	Handler() gin.HandlerFunc
}

func NewMicroVersionHandler

func NewMicroVersionHandler(service, serviceheader string, min, max *MicroVersion) Middleware

func NewTokenHandler

func NewTokenHandler(tokenManager auth.TokenManager, client identity.Interface) Middleware

func NewTokenHandlerAllowAnon

func NewTokenHandlerAllowAnon(tokenManager auth.TokenManager, client identity.Interface) Middleware

Jump to

Keyboard shortcuts

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