MCPcopy Index your code
hub / github.com/filebrowser/filebrowser / FindByUserID

Method FindByUserID

share/storage.go:52–69  ·  view source on GitHub ↗

FindByUserID wraps a StorageBackend.FindByUserID.

(id uint)

Source from the content-addressed store, hash-verified

50
51// FindByUserID wraps a StorageBackend.FindByUserID.
52func (s *Storage) FindByUserID(id uint) ([]*Link, error) {
53 links, err := s.back.FindByUserID(id)
54
55 if err != nil {
56 return nil, err
57 }
58
59 for i, link := range links {
60 if link.Expire != 0 && link.Expire <= time.Now().Unix() {
61 if err := s.Delete(link.Hash); err != nil {
62 return nil, err
63 }
64 links = append(links[:i], links[i+1:]...)
65 }
66 }
67
68 return links, nil
69}
70
71// GetByHash wraps a StorageBackend.GetByHash.
72func (s *Storage) GetByHash(hash string) (*Link, error) {

Callers

nothing calls this directly

Calls 2

DeleteMethod · 0.95
FindByUserIDMethod · 0.65

Tested by

no test coverage detected