Documentation
¶
Overview ¶
Package storage implements disk file operations.
Index ¶
- Constants
- type Config
- type File
- type Service
- func (srv Service) AddFile(token string, file *multipart.FileHeader) (key string, err error)
- func (srv Service) Close()
- func (srv Service) File(token, id string) (fileMeta *File, filePath string, err error)
- func (srv Service) FileList(token string) (files []File, err error)
- func (srv Service) FileStateChange(id, state string) error
- func (srv Service) HandlersClose()
- func (srv Service) HandlersRun()
- type UserEvent
Constants ¶
View Source
const (
// ErrNoSingleFile returned when does not contain single file in field 'file'
ErrNoSingleFile = "field 'file' does not contains single item"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { DataPath string `long:"data" default:"var/data" description:"Path to served files"` CachePath string `long:"cache" default:"var/cache" description:"Path to cache files"` }
Config holds all config vars
type Service ¶
type Service struct { Config *Config Log *log.SugaredLogger // contains filtered or unexported fields }
Service holds upload service
func (Service) FileStateChange ¶
func (Service) HandlersClose ¶
func (srv Service) HandlersClose()
func (Service) HandlersRun ¶
func (srv Service) HandlersRun()
Click to show internal directories.
Click to hide internal directories.