upload

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCosUploader

func NewCosUploader(cosUploaderInfo *CosUploaderInfo, opts ...CosUploaderOption) *cosUploader

NewCosUploader 支持传入选项参数

Types

type CosInfo

type CosInfo struct {
	PrefixUrl      string
	SavePath       string
	QSignAlgorithm string
	QAk            string
	QKeyTime       string
	QSignature     string
	Policy         string
}

CosInfo 返回的 COS 上传信息结构

type CosUploaderInfo

type CosUploaderInfo struct {
	Bucket    string
	Region    string
	SecretID  string
	SecretKey string
	SnowNode  *snowflake.Node
}

CosUploaderInfo 初始化上传器所需的基础信息

type CosUploaderOption

type CosUploaderOption func(*CosUploaderOptions)

CosUploaderOption 配置选项函数

func WithExpireTime

func WithExpireTime(seconds int64) CosUploaderOption

WithExpireTime 设置签名过期时间

func WithFileDirPrefix

func WithFileDirPrefix(prefix string) CosUploaderOption

WithFileDirPrefix 设置文件存储路径前缀

func WithMaxFileSize

func WithMaxFileSize(size int64) CosUploaderOption

WithMaxFileSize 设置最大文件大小

func WithPrefixUrl added in v1.3.1

func WithPrefixUrl(prefixUrl string) CosUploaderOption

WithPrefixUrl 设置文件存储路径前缀

type CosUploaderOptions

type CosUploaderOptions struct {
	// contains filtered or unexported fields
}

CosUploaderOptions 上传配置选项

Jump to

Keyboard shortcuts

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