routers

package
v0.0.0-...-8f6ea6c Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleScopeBindingError

func HandleScopeBindingError(c *gin.Context, err error)

Types

type ScopeRequestValidator

type ScopeRequestValidator struct {
	Scope struct {
		Name        string   `json:"name" binding:"required,min=5,max=128"`
		Description string   `json:"description" binding:"max=512"`
		Resources   []string `json:"resources" binding:"required,min=1,max=50,dive,validResource,max=128"`
		Permissions []string `json:"permissions" binding:"required,min=1,max=50,dive,validPermission,max=128"`
	} `json:"scope"`
	ScopeModel scopes.Scope `json:"-"`
}

func NewScopeValidator

func NewScopeValidator() ScopeRequestValidator

func (*ScopeRequestValidator) Bind

func (s *ScopeRequestValidator) Bind(c *gin.Context) error

type ScopeSerializer

type ScopeSerializer struct {
	C     *gin.Context
	Scope scopes.Scope
}

func (*ScopeSerializer) Response

func (s *ScopeSerializer) Response() api.ScopeForResponse

type ScopesHandler

type ScopesHandler struct {
	S scopes.ScopesRepository
}

func NewScopesHandler

func NewScopesHandler() *ScopesHandler

func (*ScopesHandler) SetupRoutes

func (S *ScopesHandler) SetupRoutes(router *gin.RouterGroup)

SetupRoutes Define the (sub)routes handled by JSONDecoratorHandler

type ScopesSerializer

type ScopesSerializer struct {
	C      *gin.Context
	Scopes scopes.Scopes
}

func (*ScopesSerializer) Response

func (s *ScopesSerializer) Response() api.ScopesResponse

Jump to

Keyboard shortcuts

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