MCPcopy
hub / github.com/filebrowser/filebrowser / Get

Method Get

users/storage.go:50–59  ·  view source on GitHub ↗

Get allows you to get a user by its name or username. The provided id must be a string for username lookup or a uint for id lookup. If id is neither, a ErrInvalidDataType will be returned.

(baseScope string, followExternalSymlinks bool, id interface{})

Source from the content-addressed store, hash-verified

48// id must be a string for username lookup or a uint for id lookup. If id
49// is neither, a ErrInvalidDataType will be returned.
50func (s *Storage) Get(baseScope string, followExternalSymlinks bool, id interface{}) (user *User, err error) {
51 user, err = s.back.GetBy(id)
52 if err != nil {
53 return
54 }
55 if err := user.Clean(baseScope, followExternalSymlinks); err != nil {
56 return nil, err
57 }
58 return
59}
60
61// GetByScope returns the first user whose scope matches the given one, or
62// ErrNotExist if none does. The user is returned as stored, without setting up

Callers

nothing calls this directly

Calls 2

GetByMethod · 0.65
CleanMethod · 0.45

Tested by

no test coverage detected