storage

package
v0.44.8 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2025 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AlistStorageConfig

type AlistStorageConfig struct {
	BaseConfig
	URL      string `toml:"url" mapstructure:"url" json:"url"`
	Username string `toml:"username" mapstructure:"username" json:"username"`
	Password string `toml:"password" mapstructure:"password" json:"password"`
	Token    string `toml:"token" mapstructure:"token" json:"token"`
	BasePath string `toml:"base_path" mapstructure:"base_path" json:"base_path"`
	TokenExp int64  `toml:"token_exp" mapstructure:"token_exp" json:"token_exp"`
}

func (*AlistStorageConfig) GetName

func (a *AlistStorageConfig) GetName() string

func (*AlistStorageConfig) GetType

func (*AlistStorageConfig) Validate

func (a *AlistStorageConfig) Validate() error

type BaseConfig

type BaseConfig struct {
	Name      string         `toml:"name" mapstructure:"name" json:"name"`
	Type      string         `toml:"type" mapstructure:"type" json:"type"`
	Enable    bool           `toml:"enable" mapstructure:"enable" json:"enable"`
	RawConfig map[string]any `toml:"-" mapstructure:",remain"`
}

type LocalStorageConfig

type LocalStorageConfig struct {
	BaseConfig
	BasePath string `toml:"base_path" mapstructure:"base_path" json:"base_path"`
}

func (*LocalStorageConfig) GetName

func (l *LocalStorageConfig) GetName() string

func (*LocalStorageConfig) GetType

func (*LocalStorageConfig) Validate

func (l *LocalStorageConfig) Validate() error

type MinioStorageConfig

type MinioStorageConfig struct {
	BaseConfig
	Endpoint        string `toml:"endpoint" mapstructure:"endpoint" json:"endpoint"`
	AccessKeyID     string `toml:"access_key_id" mapstructure:"access_key_id" json:"access_key_id"`
	SecretAccessKey string `toml:"secret_access_key" mapstructure:"secret_access_key" json:"secret_access_key"`
	BucketName      string `toml:"bucket_name" mapstructure:"bucket_name" json:"bucket_name"`
	UseSSL          bool   `toml:"use_ssl" mapstructure:"use_ssl" json:"use_ssl"`
	BasePath        string `toml:"base_path" mapstructure:"base_path" json:"base_path"`
}

func (*MinioStorageConfig) GetName

func (m *MinioStorageConfig) GetName() string

func (*MinioStorageConfig) GetType

func (*MinioStorageConfig) Validate

func (m *MinioStorageConfig) Validate() error

type S3StorageConfig added in v0.41.0

type S3StorageConfig struct {
	BaseConfig
	Endpoint        string `toml:"endpoint" mapstructure:"endpoint" json:"endpoint"`
	AccessKeyID     string `toml:"access_key_id" mapstructure:"access_key_id" json:"access_key_id"`
	SecretAccessKey string `toml:"secret_access_key" mapstructure:"secret_access_key" json:"secret_access_key"`
	BucketName      string `toml:"bucket_name" mapstructure:"bucket_name" json:"bucket_name"`
	UseSSL          bool   `toml:"use_ssl" mapstructure:"use_ssl" json:"use_ssl"`
	BasePath        string `toml:"base_path" mapstructure:"base_path" json:"base_path"`
	Region          string `toml:"region" mapstructure:"region" json:"region"`
	VirtualHost     bool   `toml:"virtual_host" mapstructure:"virtual_host" json:"virtual_host"`
}

func (*S3StorageConfig) GetName added in v0.41.0

func (m *S3StorageConfig) GetName() string

func (*S3StorageConfig) GetType added in v0.41.0

func (m *S3StorageConfig) GetType() storenum.StorageType

func (*S3StorageConfig) Validate added in v0.41.0

func (m *S3StorageConfig) Validate() error

type StorageConfig

type StorageConfig interface {
	Validate() error
	GetType() storenum.StorageType
	GetName() string
}

func LoadStorageConfigs

func LoadStorageConfigs(v *viper.Viper) ([]StorageConfig, error)

type TelegramStorageConfig added in v0.23.0

type TelegramStorageConfig struct {
	BaseConfig
	ChatID    int64 `toml:"chat_id" mapstructure:"chat_id" json:"chat_id"`
	ForceFile bool  `toml:"force_file" mapstructure:"force_file" json:"force_file"`
	RateLimit int   `toml:"rate_limit" mapstructure:"rate_limit" json:"rate_limit"`
	RateBurst int   `toml:"rate_burst" mapstructure:"rate_burst" json:"rate_burst"`
	SkipLarge bool  `toml:"skip_large" mapstructure:"skip_large" json:"skip_large"` // skip files larger than Telegram limit(2GB)
	// split files larger than Telegram limit(2GB) into parts of specified size, in MB, leave 0 to set default(2000MB)
	// only effective when SkipLarge is false
	// use zip when splitting
	SplitSizeMB int64 `toml:"split_size_mb" mapstructure:"split_size_mb" json:"split_size_mb"`
}

func (*TelegramStorageConfig) GetName added in v0.23.0

func (m *TelegramStorageConfig) GetName() string

func (*TelegramStorageConfig) GetType added in v0.23.0

func (*TelegramStorageConfig) Validate added in v0.23.0

func (m *TelegramStorageConfig) Validate() error

type WebdavStorageConfig

type WebdavStorageConfig struct {
	BaseConfig
	URL      string `toml:"url" mapstructure:"url" json:"url"`
	Username string `toml:"username" mapstructure:"username" json:"username"`
	Password string `toml:"password" mapstructure:"password" json:"password"`
	BasePath string `toml:"base_path" mapstructure:"base_path" json:"base_path"`
}

func (*WebdavStorageConfig) GetName

func (w *WebdavStorageConfig) GetName() string

func (*WebdavStorageConfig) GetType

func (*WebdavStorageConfig) Validate

func (w *WebdavStorageConfig) Validate() error

Jump to

Keyboard shortcuts

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