share

package
v0.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 28, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidToken = errors.New("invalid share token")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	ShareTokenJSONFile string

	Encrypt    bool
	PassPhrase [32]byte
}

type FileStorage

type FileStorage interface {
	GetFiles(ids ...int) []files.File
}

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) CheckFile

func (st ShareService) CheckFile(token string, id int) bool

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 (st ShareService) FilterFiles(token string, files []filesPck.File) ([]filesPck.File, error)

func (ShareService) FilterTags

func (st ShareService) FilterTags(token string, tags tagsPck.Tags) (tagsPck.Tags, error)

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL