Documentation ¶
Index ¶
- Variables
- type Config
- type FileStorage
- type ShareService
- func (st ShareService) CheckFile(token string, id int) bool
- func (st ShareService) CheckToken(token string) bool
- func (st ShareService) CreateToken(ids []int) (token string)
- func (st ShareService) DeleteFile(id int)
- func (st ShareService) DeleteToken(token string)
- func (st ShareService) FilterFiles(token string, files []filesPck.File) ([]filesPck.File, error)
- func (st ShareService) FilterTags(token string, tags tagsPck.Tags) (tagsPck.Tags, error)
- func (st ShareService) GetAllTokens() map[string][]int
- func (st ShareService) GetFilesIDs(token string) ([]int, error)
- func (st ShareService) Shutdown() error
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrInvalidToken = errors.New("invalid share token")
)
Functions ¶
This section is empty.
Types ¶
type FileStorage ¶
type ShareService ¶
type ShareService struct {
// contains filtered or unexported fields
}
func NewShareStorage ¶
func NewShareStorage(cnf Config, fs FileStorage, lg *clog.Logger) (*ShareService, error)
func (ShareService) CheckToken ¶
func (st ShareService) CheckToken(token string) bool
func (ShareService) CreateToken ¶
func (st ShareService) CreateToken(ids []int) (token string)
func (ShareService) DeleteFile ¶
func (st ShareService) DeleteFile(id int)
func (ShareService) DeleteToken ¶
func (st ShareService) DeleteToken(token string)
func (ShareService) FilterFiles ¶
func (ShareService) FilterTags ¶
func (ShareService) GetAllTokens ¶
func (st ShareService) GetAllTokens() map[string][]int
func (ShareService) GetFilesIDs ¶
func (st ShareService) GetFilesIDs(token string) ([]int, error)
func (ShareService) Shutdown ¶
func (st ShareService) Shutdown() error
Click to show internal directories.
Click to hide internal directories.