dfs

package
v0.0.0-...-0b7460b Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CloudStorageConfig

type CloudStorageConfig struct {
	Base64Json string `yaml:"base64_json"`
}

type Config

type Config struct {
	Type         DFSType             `yaml:"type"` // s3/minio/cloud_storage
	Enable       bool                `yaml:"enable"`
	Bucket       string              `yaml:"bucket"`
	ExpireDays   TimeDays            `yaml:"expire_days"` // 桶数据过期时间
	S3           *S3Config           `yaml:"s3"`
	Minio        *MinioConfig        `yaml:"minio"`
	CloudStorage *CloudStorageConfig `yaml:"cloud_storage"`
	Huaweicloud  *HuaweiObsConfig    `yaml:"huawei_obs"`

	// deprecated:兼容旧版本配置
	Url string `yaml:"url"`
	// deprecated:兼容旧版本配置
	KeyID string `yaml:"key_id"`
	// deprecated:兼容旧版本配置
	Key string `yaml:"key"`
}

type DFSHandler

type DFSHandler interface {
	TryMakeBucket() error
	PutObject(path, fileName string, payload []byte) error
	GetObject(path, fileName string) ([]byte, error)
	DelObject(path, fileName string) error
}

func NewHandler

func NewHandler(config *Config) (DFSHandler, error)

type DFSType

type DFSType = string
var (
	DFSType_Minio       DFSType = "minio"
	DFSType_S3          DFSType = "s3"
	DFSType_CloudStorge DFSType = "cloudStorage"
	DFSType_HUAWEI_Obs  DFSType = "huawei-obs"
)

type HuaweiObsConfig

type HuaweiObsConfig struct {
	Url    string `yaml:"url"`
	Bucket string `yaml:"bucket"`
	KeyID  string `yaml:"key_id"`
	Key    string `yaml:"key"`
}

type MinioConfig

type MinioConfig struct {
	Url    string `yaml:"url"`
	Bucket string `yaml:"bucket"`
	KeyID  string `yaml:"key_id"`
	Key    string `yaml:"key"`
}

type S3Config

type S3Config struct {
	Url    string `yaml:"url"`
	Bucket string `yaml:"bucket"`
	KeyID  string `yaml:"key_id"`
	Key    string `yaml:"key"`
}

type TimeDays

type TimeDays = int

Jump to

Keyboard shortcuts

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