More updates :)
This commit is contained in:
4 files changed
+20
-7
No files matched your search
@@ -2,6 +2,7 @@ package bolt
|
||||
|
||||
import (
|
||||
"github.com/asdine/storm"
|
||||
"github.com/asdine/storm/q"
|
||||
fm "github.com/hacdias/filemanager"
|
||||
)
|
||||
|
||||
@@ -19,6 +20,16 @@ func (s ShareStore) Get(hash string) (*fm.ShareLink, error) {
|
||||
return v, err
|
||||
}
|
||||
|
||||
func (s ShareStore) GetPermanent(path string) (*fm.ShareLink, error) {
|
||||
var v *fm.ShareLink
|
||||
err := s.DB.Select(q.Eq("Path", path), q.Eq("Expires", false)).First(&v)
|
||||
if err == storm.ErrNotFound {
|
||||
return v, fm.ErrNotExist
|
||||
}
|
||||
|
||||
return v, err
|
||||
}
|
||||
|
||||
func (s ShareStore) GetByPath(hash string) ([]*fm.ShareLink, error) {
|
||||
var v []*fm.ShareLink
|
||||
err := s.DB.Find("Path", hash, &v)
|
||||
|
||||
Reference in new issue
Block a user