mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-20 21:41:55 +00:00
31 lines
648 B
Go
31 lines
648 B
Go
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")
|
|
}
|
|
*/
|