Documentation ¶
Index ¶
- type StaticFilesStorage
- func (sfs *StaticFilesStorage) AdminPanelHandlers() *model.AdminPanelHandlers
- func (sfs *StaticFilesStorage) AssetHandlers() *model.AssetHandlers
- func (sfs *StaticFilesStorage) Close()
- func (sfs *StaticFilesStorage) GetAppleFile(name string) ([]byte, error)
- func (sfs *StaticFilesStorage) GetFile(name string) ([]byte, error)
- func (sfs *StaticFilesStorage) ParseTemplate(templateName string) (*template.Template, error)
- func (sfs *StaticFilesStorage) UploadFile(name string, contents []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type StaticFilesStorage ¶
type StaticFilesStorage struct {
Folder string
}
StaticFilesStorage is a local storage of static files.
func NewStaticFilesStorage ¶
func NewStaticFilesStorage(settings model.StaticFilesStorageSettings) (*StaticFilesStorage, error)
NewStaticFilesStorage creates and returns new local static files storage.
func (*StaticFilesStorage) AdminPanelHandlers ¶
func (sfs *StaticFilesStorage) AdminPanelHandlers() *model.AdminPanelHandlers
AdminPanelHandlers returns handlers for the admin panel.
func (*StaticFilesStorage) AssetHandlers ¶
func (sfs *StaticFilesStorage) AssetHandlers() *model.AssetHandlers
AssetHandlers returns handlers for assets.
func (*StaticFilesStorage) Close ¶
func (sfs *StaticFilesStorage) Close()
Close is to satisfy the interface.
func (*StaticFilesStorage) GetAppleFile ¶
func (sfs *StaticFilesStorage) GetAppleFile(name string) ([]byte, error)
GetAppleFile is for reading Apple-related static files. Unlike generic GetFile, it does not treat model.ErrorNotFound as error.
func (*StaticFilesStorage) GetFile ¶
func (sfs *StaticFilesStorage) GetFile(name string) ([]byte, error)
GetFile is for fetching a file from a local file system.
func (*StaticFilesStorage) ParseTemplate ¶
func (sfs *StaticFilesStorage) ParseTemplate(templateName string) (*template.Template, error)
ParseTemplate parses the html template.
func (*StaticFilesStorage) UploadFile ¶
func (sfs *StaticFilesStorage) UploadFile(name string, contents []byte) error
UploadFile is a generic file uploader.
Click to show internal directories.
Click to hide internal directories.