Documentation
¶
Index ¶
- type DriverConfig
- type FileDriver
- type LocalDriver
- func (d *LocalDriver) Delete(ctx *app.RequestContext, path string) error
- func (d *LocalDriver) Get(ctx *app.RequestContext, path string)
- func (d *LocalDriver) ListDir(ctx *app.RequestContext, path string) ([]os.FileInfo, error)
- func (d *LocalDriver) Open(ctx *app.RequestContext, path string) (io.ReadCloser, error)
- func (d *LocalDriver) Save(ctx *app.RequestContext, path string, r io.Reader) error
- func (d *LocalDriver) Stat(ctx *app.RequestContext, path string) (os.FileInfo, error)
- type WebDAVClientDriver
- func (d *WebDAVClientDriver) Delete(ctx *app.RequestContext, p string) error
- func (d *WebDAVClientDriver) Get(ctx *app.RequestContext, p string)
- func (d *WebDAVClientDriver) ListDir(ctx *app.RequestContext, p string) ([]os.FileInfo, error)
- func (d *WebDAVClientDriver) Open(ctx *app.RequestContext, p string) (io.ReadCloser, error)
- func (d *WebDAVClientDriver) Save(ctx *app.RequestContext, p string, r io.Reader) error
- func (d *WebDAVClientDriver) Stat(ctx *app.RequestContext, p string) (os.FileInfo, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DriverConfig ¶
type DriverConfig struct {
Type string `mapstructure:"file.driver.type"`
BasePath string `mapstructure:"file.driver.base_path"`
WebDavUrl string `mapstructure:"file.driver.webdav.url"`
WebDavUser string `mapstructure:"file.driver.webdav.user"`
WebDavPassword string `mapstructure:"file.driver.webdav.password"`
WebDavPolicy string `mapstructure:"file.driver.webdav.policy"` // proxy|redirect
}
type FileDriver ¶
type FileDriver interface {
Save(ctx *app.RequestContext, path string, r io.Reader) error
Open(ctx *app.RequestContext, path string) (io.ReadCloser, error)
Delete(ctx *app.RequestContext, path string) error
Stat(ctx *app.RequestContext, path string) (os.FileInfo, error)
Get(ctx *app.RequestContext, path string)
ListDir(ctx *app.RequestContext, path string) ([]os.FileInfo, error)
}
func GetFileDriver ¶
func GetFileDriver(driverConfig *DriverConfig) (FileDriver, error)
type LocalDriver ¶
type LocalDriver struct {
BasePath string
}
func NewLocalDriver ¶
func NewLocalDriver(driverConfig *DriverConfig) *LocalDriver
func (*LocalDriver) Delete ¶
func (d *LocalDriver) Delete(ctx *app.RequestContext, path string) error
func (*LocalDriver) Get ¶
func (d *LocalDriver) Get(ctx *app.RequestContext, path string)
func (*LocalDriver) ListDir ¶
func (d *LocalDriver) ListDir(ctx *app.RequestContext, path string) ([]os.FileInfo, error)
func (*LocalDriver) Open ¶
func (d *LocalDriver) Open(ctx *app.RequestContext, path string) (io.ReadCloser, error)
func (*LocalDriver) Save ¶
func (d *LocalDriver) Save(ctx *app.RequestContext, path string, r io.Reader) error
func (*LocalDriver) Stat ¶
func (d *LocalDriver) Stat(ctx *app.RequestContext, path string) (os.FileInfo, error)
type WebDAVClientDriver ¶
type WebDAVClientDriver struct {
BasePath string
// contains filtered or unexported fields
}
func NewWebDAVClientDriver ¶
func NewWebDAVClientDriver(driverConfig *DriverConfig) *WebDAVClientDriver
func (*WebDAVClientDriver) Delete ¶
func (d *WebDAVClientDriver) Delete(ctx *app.RequestContext, p string) error
func (*WebDAVClientDriver) Get ¶
func (d *WebDAVClientDriver) Get(ctx *app.RequestContext, p string)
func (*WebDAVClientDriver) ListDir ¶
func (d *WebDAVClientDriver) ListDir(ctx *app.RequestContext, p string) ([]os.FileInfo, error)
func (*WebDAVClientDriver) Open ¶
func (d *WebDAVClientDriver) Open(ctx *app.RequestContext, p string) (io.ReadCloser, error)
func (*WebDAVClientDriver) Save ¶
func (d *WebDAVClientDriver) Save(ctx *app.RequestContext, p string, r io.Reader) error
func (*WebDAVClientDriver) Stat ¶
func (d *WebDAVClientDriver) Stat(ctx *app.RequestContext, p string) (os.FileInfo, error)
Click to show internal directories.
Click to hide internal directories.