static

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitFileUrl added in v1.8.0

func InitFileUrl(fileUrl string, config *Config) (string, string)

规划图片文件路径

func RemoveFile

func RemoveFile(config *Config, fileUrl string, removeLocalFile bool) error

上传文件到云存储

func UploadFile

func UploadFile(config *Config, fileUrl string) error

上传文件到云存储

Types

type AliOSS

type AliOSS struct {
	Endpoint        string
	AccessKeyId     string
	AccessKeySecret string
	BucketName      string
	BaseUrl         string
}

func (AliOSS) InitClient

func (aliOSS AliOSS) InitClient() (*oss.Client, error)

func (AliOSS) RemoveFile

func (aliOSS AliOSS) RemoveFile(cloudFileUrl string, localFileUrl string, removeLocalFile bool) error

Remove AliOSS File

func (AliOSS) UploadFile

func (aliOSS AliOSS) UploadFile(cloudFileUrl string, localFileUrl string) error

upload a file to aliOSS

type Config

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

type Local

type Local struct {
	BaseUrl string
}

func (Local) RemoveFile

func (m Local) RemoveFile(fileUrl string) error

Remove AliOSS File

func (Local) UploadFile

func (m Local) UploadFile(fileUrl string) error

type TencentCOS

type TencentCOS struct {
	BucketURL string
	SecretId  string
	SecretKey string
	BaseUrl   string
}

func (TencentCOS) InitClient

func (m TencentCOS) InitClient() *cos.Client

初始化客户端

func (*TencentCOS) RemoveFile

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

删除文件

func (*TencentCOS) UploadFile

func (m *TencentCOS) UploadFile(cloudFileUrl string, localFileUrl string) error

上传文件

Jump to

Keyboard shortcuts

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