static

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitFileUrl

func InitFileUrl(fileUrl string, config Config) (localUrl string, cloudUrl string)

规划文件路径

func MoveFile added in v0.1.2

func MoveFile(fileUrl string, targerUrl string) error

Types

type AliOSS

type AliOSS struct {
	Client *oss.Client
	Ready  bool
	Config Config
	Bucket *oss.Bucket
}

func (*AliOSS) DownloadFile added in v0.0.6

func (m *AliOSS) DownloadFile(fileUrl string) error

下载文件

func (*AliOSS) InitClient

func (m *AliOSS) InitClient(config Config)

func (*AliOSS) MoveFile added in v0.1.2

func (m *AliOSS) MoveFile(fileUrl string, targerDir string) (string, error)

func (*AliOSS) RemoveFile

func (m *AliOSS) RemoveFile(fileUrl string, removeLocalFile bool) error

Remove File

func (*AliOSS) UploadFile

func (m *AliOSS) UploadFile(fileUrl string) error

Upload File

type Config

type Config struct {
	Endpoint     string
	KeyId        string
	Secret       string
	BucketName   string
	LocalBaseUrl string
	BaseUrl      string
	Type         string
}

type Local

type Local struct {
	Config Config
}

Local 实现 StaticCloud 接口

func (*Local) DownloadFile added in v0.1.2

func (l *Local) DownloadFile(fileUrl string) error

func (*Local) InitClient added in v0.1.2

func (l *Local) InitClient(config Config)

func (*Local) MoveFile added in v0.1.2

func (l *Local) MoveFile(fileUrl string, targerDir string) (string, error)

func (*Local) RemoveFile

func (l *Local) RemoveFile(fileUrl string, removeLocalFile bool) error

func (*Local) UploadFile

func (l *Local) UploadFile(fileUrl string) error

type StaticCloud added in v0.1.2

type StaticCloud interface {
	InitClient(config Config)
	UploadFile(fileUrl string) error
	DownloadFile(fileUrl string) error
	RemoveFile(fileUrl string, removeLocalFile bool) error
	MoveFile(fileUrl string, targerDir string) (string, error)
}

func New added in v0.1.2

func New(config Config) StaticCloud

type TencentCOS

type TencentCOS struct {
	Client *cos.Client
	Ready  bool
	Config Config
}

func (*TencentCOS) DownloadFile added in v0.0.6

func (m *TencentCOS) DownloadFile(fileUrl string) error

下载文件

func (*TencentCOS) InitClient

func (m *TencentCOS) InitClient(config Config)

初始化客户端

func (*TencentCOS) MoveFile added in v0.1.2

func (m *TencentCOS) MoveFile(fileUrl string, targerDir string) (string, error)

func (*TencentCOS) RemoveFile

func (m *TencentCOS) RemoveFile(fileUrl string, removeLocalFile bool) error

删除文件

func (*TencentCOS) UploadFile

func (m *TencentCOS) UploadFile(fileUrl string) error

上传文件

Jump to

Keyboard shortcuts

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