Debian Codegraph @

api/v1/lib/resources/role.go

raw symbols SCIP
1 package resources
2
3 type Role string
4
5 const RoleDefault = Role("*")
6
7 func (r Role) IsDefault() bool {
8 return r == RoleDefault
9 }
10
11 func (r Role) Assign() func(interface{}) {
12 return func(v interface{}) {
13 type roler interface {
14 WithRole(string)
15 }
16 if ri, ok := v.(roler); ok {
17 ri.WithRole(string(r))
18 }
19 }
20 }
21
22 func (r Role) Proto() *string {
23 s := string(r)
24 return &s
25 }