util

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const G = M * 1024
View Source
const K = 1024
View Source
const M = 1024 * 1024

Variables

This section is empty.

Functions

func GetDirFiles

func GetDirFiles(dir string) []string

func GetFileName

func GetFileName(path string) string

获取文件名

func GetFileSize

func GetFileSize(size int64) interface{}

获取文件大小

func InitBucket

func InitBucket(ossConfig config.OssConfig) *oss.Bucket

初始化 Bucket

func IsDir

func IsDir(path string) bool

判断是否是文件夹

func IsFileExist

func IsFileExist(path string) bool

判断文件是否存在

func PrintInMarkdownFormat

func PrintInMarkdownFormat(resultMap map[string]string)

func PrintInTextPlain

func PrintInTextPlain(resultMap map[string]string)

func UploadFile

func UploadFile(ossPath string, localFilePath string, config config.OssConfig, bucket oss.Bucket) (string, string)

上传文件

func ValidateConfig

func ValidateConfig(ossConfig config.OssConfig) bool

校验配置是否正确

Types

type OssProgressListener

type OssProgressListener struct {
}

定义进度条监听器。

func (*OssProgressListener) ProgressChanged

func (listener *OssProgressListener) ProgressChanged(event *oss.ProgressEvent)

定义进度变更事件处理函数。

Jump to

Keyboard shortcuts

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