I have a list of access rights:
const (
Everyone = 0
Owner = 1
Administrator = 2
)
And a struct representing Routes:
type Route struct {
Name string
Method string
Pattern string
HandlerFunc http.HandlerFunc
AccessLevel uint64
}
How can I restrict AccessLevel
field value of the Route
struct be only one of those const from above?