routes

package
v0.0.0-...-6690001 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2019 License: GPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	View   = validation.View
	Edit   = validation.Edit
	Create = validation.Create
	Delete = validation.Delete
)

Re-declare so that don't have to use the package prefix to make it look nicer

View Source
const (
	MinPasswordLength = 8
)

Variables

View Source
var IconManager icons.IconManager
View Source
var LeagueOfLegendsDAO dataModel.LeagueOfLegendsDAO
View Source
var LoLTournamentApi lolApi.LoLTournamentApi
View Source
var MarkdownManager markdown.MdManager

Objects

View Source
var ValidGameStrings = [...]string{
	"genericsport",
	"basketball",
	"curling",
	"football",
	"hockey",
	"rugby",
	"soccer",
	"volleyball",
	"waterpolo",
	"genericesport",
	"csgo",
	"leagueoflegends",
	"overwatch",
}

Functions

func Authenticate

func Authenticate() gin.HandlerFunc

func DataInvalid

func DataInvalid(ctx *gin.Context, valid bool, problem string, err error) bool

func HasPermissions

func HasPermissions(ctx *gin.Context, entity Entity, accessType validation.AccessType) (bool, error)

func InitRoutes

func InitRoutes(conf config.Config) *gin.Engine

func RegisterGameHandlers

func RegisterGameHandlers(g *gin.RouterGroup)

func RegisterLeagueHandlers

func RegisterLeagueHandlers(g *gin.RouterGroup)

func RegisterLeagueOfLegendsHandlers

func RegisterLeagueOfLegendsHandlers(g *gin.RouterGroup)

func RegisterLoginHandlers

func RegisterLoginHandlers(g *gin.RouterGroup)

func RegisterSchedulingHandlers

func RegisterSchedulingHandlers(g *gin.RouterGroup)

func RegisterTeamHandlers

func RegisterTeamHandlers(g *gin.RouterGroup)

func RegisterUserHandlers

func RegisterUserHandlers(g *gin.RouterGroup)

Types

type Entity

type Entity int
const (
	User         Entity = iota
	League       Entity = iota
	Team         Entity = iota
	Player       Entity = iota
	Game         Entity = iota
	Report       Entity = iota
	Availability Entity = iota
)

type Validator

type Validator interface {
	DataInvalid(*gin.Context, func() (bool, string, error)) bool
}

Wrapper for data validator functions so that they can be mocked during unit testing

type ValidatorWrapper

type ValidatorWrapper struct{}

func (*ValidatorWrapper) DataInvalid

func (v *ValidatorWrapper) DataInvalid(ctx *gin.Context, validateEdit func() (bool, string, error)) bool

Jump to

Keyboard shortcuts

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