MCPcopy
hub / github.com/tinode/chat / ParseAuthLevel

Function ParseAuthLevel

server/auth/auth.go:38–49  ·  view source on GitHub ↗

ParseAuthLevel parses authentication level from a string.

(name string)

Source from the content-addressed store, hash-verified

36
37// ParseAuthLevel parses authentication level from a string.
38func ParseAuthLevel(name string) Level {
39 switch name {
40 case "anon", "ANON":
41 return LevelAnon
42 case "auth", "AUTH":
43 return LevelAuth
44 case "root", "ROOT":
45 return LevelRoot
46 default:
47 return LevelNone
48 }
49}
50
51// MarshalText converts Level to a slice of bytes with the name of the level.
52func (a Level) MarshalText() ([]byte, error) {

Callers 4

genDbFunction · 0.92
dispatchMethod · 0.92
replyUpdateUserFunction · 0.92
mainFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…