oss

package module
v0.0.19 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2026 License: MIT Imports: 8 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OSS

type OSS interface {
	// Upload 上传本地文件。
	Upload(fileName string, filePath string, localFile string) (string, error)
	// UploadByByte 上传内存数据。
	UploadByByte(fileName string, filePath string, fileByte []byte) (string, error)
	// GetFileByte 下载对象内容。
	GetFileByte(filePath string) ([]byte, error)
	// DeleteFile 删除对象。
	DeleteFile(filePath string) error
}

OSS 定义项目统一使用的对象存储能力。

func NewOSS

func NewOSS(cfg *configv1.Oss) (OSS, error)

NewOSS 创建对象存储,并返回配置或客户端初始化错误。

type Type

type Type string

Type 表示对象存储类型。

const (
	// Local 表示本地文件存储。
	Local Type = "local"
	// Aliyun 表示阿里云 OSS。
	Aliyun Type = "aliyun"
	// Ftp 表示 FTP 存储。
	Ftp Type = "ftp"
	// Minio 表示 MinIO 对象存储。
	Minio Type = "minio"
	// S3 表示 AWS S3 及兼容对象存储。
	S3 Type = "s3"
)

Directories

Path Synopsis
s3 module

Jump to

Keyboard shortcuts

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