qiniu

package
v1.1.8 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DQiniu = &Qiniu{
	AccessKey: "xxx",
	SecretKey: "xxx",
	Bucket:    "images-mkd",
	Zone:      &storage.ZoneHuanan,
	Domain:    "http://image.youthsweet.com",
}

Functions

This section is empty.

Types

type Qiniu

type Qiniu struct {
	AccessKey string // 秘钥对
	SecretKey string
	Bucket    string        // 空间(桶)
	Zone      *storage.Zone // 地域:
	Domain    string
}

func (*Qiniu) DeleteFile

func (obj *Qiniu) DeleteFile(filename string) error

DeleteFile 删除bucket中的文件

func (*Qiniu) GetOutsideChain

func (obj *Qiniu) GetOutsideChain(prefix string) (urls []string)

GetOutsideChain 根据前缀匹配获取外链

func (*Qiniu) PutFile

func (obj *Qiniu) PutFile(filepath string, filename string)

PutFile 上传文件

func (*Qiniu) SyncLocalToQiniu

func (obj *Qiniu) SyncLocalToQiniu(localDir string, qiniuDir string, minute int)

SyncLocalToQiniu 同步本地目录到七牛,若minute=30,即只同步最近半小时的新文件

Jump to

Keyboard shortcuts

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