mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-20 13:31:56 +00:00
initial commit
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
package utils
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
// FlagType
|
||||
// -------------------------------------------------------------------
|
||||
type FlagType string
|
||||
|
||||
const (
|
||||
FlagIsActive FlagType = "IS_ACTIVE"
|
||||
)
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
// Validators
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
func IsValidFlagType(v string) bool {
|
||||
switch FlagType(v) {
|
||||
case FlagIsActive:
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// example use
|
||||
|
||||
/**
|
||||
if !utils.IsValidFlagType(req.FlagName) {
|
||||
return fiber.NewError(fiber.StatusBadRequest, "invalid flag type")
|
||||
}
|
||||
*/
|
||||
Reference in New Issue
Block a user