minio

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Config               = ttviper.ConfigInit("TIKTOK_MINIO", "minioConfig")
	MinioEndpoint        = Config.Viper.GetString("minio.Endpoint")
	MinioAccessKeyId     = Config.Viper.GetString("minio.AccessKeyId")
	MinioSecretAccessKey = Config.Viper.GetString("minio.SecretAccessKey")
	MinioUseSSL          = Config.Viper.GetBool("minio.UseSSL")
	MinioVideoBucketName = Config.Viper.GetString("minio.VideoBucketName")
)

Functions

func CreateBucket

func CreateBucket(bucketName string) error

CreateBucket 创建桶

func GetFileUrl

func GetFileUrl(bucketName string, fileName string, expires time.Duration) (*url.URL, error)

GetFileUrl 从 minio 获取文件Url

func UploadFile

func UploadFile(bucketName string, objectName string, reader io.Reader, objectsize int64) error

UploadFile 上传文件(提供reader)至 minio

func UploadLocalFile

func UploadLocalFile(bucketName string, objectName string, filePath string, contentType string) (int64, error)

UploadLocalFile 上传本地文件(提供文件路径)至 minio

Types

This section is empty.

Jump to

Keyboard shortcuts

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