Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFound = sqlx.ErrNotFound
Functions ¶
This section is empty.
Types ¶
type Proxy ¶
type Proxy struct {
WebProxy bool `json:"web_proxy" gorm:"not null"`
WebdavPolicy string `json:"webdav_policy"`
DownProxyUrl string `json:"down_proxy_url"`
}
func (Proxy) WebdavNative ¶
func (Proxy) WebdavProxy ¶
type Storage ¶
type Storage struct {
ID uint `json:"id" gorm:"primaryKey"` // unique key
MountPath string `json:"mount_path" gorm:"unique;not null" binding:"required"` // must be standardized
Order int64 `json:"order" gorm:"not null"` // use to sort
Driver string `json:"driver" gorm:"not null"` // driver used
CacheExpiration int64 `json:"cache_expiration" gorm:"not null"` // cache expire time
Status string `json:"status" gorm:"not null"`
Addition string `json:"addition" gorm:"type:text;not null"` // Additional information, defined in the corresponding driver
Remark string `json:"remark"`
CreateTime time.Time `json:"created_time"`
UpdateTime time.Time `json:"update_time"`
Disabled bool `json:"disabled" gorm:"not null"` // if disabled
Proxy
ExtractFolder string `json:"extract_folder"`
}
func (*Storage) GetStorage ¶
func (*Storage) SetStorage ¶
type Storages ¶
type Storages struct {
Id int64 `db:"id"`
MountPath string `db:"mount_path"`
Order int64 `db:"order"`
Driver string `db:"driver"`
CacheExpiration int64 `db:"cache_expiration"`
Status string `db:"status"`
Addition string `db:"addition"`
Remark sql.NullString `db:"remark"`
CreateTime time.Time `db:"create_time"`
UpdateTime time.Time `db:"update_time"`
Disabled bool `db:"disabled"`
WebProxy bool `db:"web_proxy"`
WebdavPolicy sql.NullString `db:"webdav_policy"`
DownProxyUrl sql.NullString `db:"down_proxy_url"`
ExtractFolder sql.NullString `db:"extract_folder"`
}
type StoragesModel ¶
type StoragesModel interface {
FindAllEnabled(ctx context.Context) ([]*Storages, error)
FindAll(ctx context.Context) ([]*Storages, error)
UpdataDisabled(ctx context.Context, id int64, disabled bool) error
// contains filtered or unexported methods
}
StoragesModel is an interface to be customized, add more methods here, and implement the added methods in customStoragesModel.
func NewStoragesModel ¶
func NewStoragesModel(conn sqlx.SqlConn, c cache.CacheConf) StoragesModel
NewStoragesModel returns a model for the database table.
Click to show internal directories.
Click to hide internal directories.