MCPcopy
hub / github.com/filebrowser/filebrowser / getUserIdentifier

Function getUserIdentifier

cmd/rules.go:71–89  ·  view source on GitHub ↗
(flags *pflag.FlagSet)

Source from the content-addressed store, hash-verified

69}
70
71func getUserIdentifier(flags *pflag.FlagSet) (interface{}, error) {
72 id, err := flags.GetUint("id")
73 if err != nil {
74 return nil, err
75 }
76
77 username, err := flags.GetString("username")
78 if err != nil {
79 return nil, err
80 }
81
82 if id != 0 {
83 return id, nil
84 } else if username != "" {
85 return username, nil
86 }
87
88 return nil, nil
89}
90
91func printRules(rulez []rules.Rule, id interface{}) {
92 if id == nil {

Callers 1

runRulesFunction · 0.85

Calls 1

GetStringMethod · 0.80

Tested by

no test coverage detected