fileStore

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2020 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileData

type FileData struct {
	Domain  string `json:"domain"`  // 域名
	Md5     string `json:"md5"`     // md5
	Mtime   int64  `json:"mtime"`   // 时间戳秒
	Path    string `json:"path"`    // 路径
	Retcode int    `json:"retcode"` // 响应码
	Retmsg  string `json:"retmsg"`  // 响应内容
	Scene   string `json:"scene"`   // 上传到的场景
	Scenes  string `json:"scenes"`  // 支持的场景
	Size    int    `json:"size"`    // 文件大小
	Src     string `json:"src"`     // 文件地址
	Url     string `json:"url"`     // 文件访问地址
}

文件信息

type IStoreClient

type IStoreClient interface {
	//文件上传
	//fileName  文件名称
	//file      文件数据
	//返回 文件路径
	Upload(fileName string, file []byte) (string, error)
	//文件下载
	//path      文件路径
	Delete(path string) (bool, error)
}

文件存储客户端

func NewStoreClient

func NewStoreClient(ipport string, group string, scene string) IStoreClient

实例化文件上传客户端 ipport ip和端口 group 组名称(可以按照这个分集群) scene 场景(可以按这个分类)

type ResultData

type ResultData struct {
	Data    FileData `json:"data"`    //数据
	Message string   `json:"message"` //消息
	Status  string   `json:"status"`  //状态
}

请求结果数据

type StoreClient

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

文件上传客户端

func (*StoreClient) Delete

func (client *StoreClient) Delete(path string) (bool, error)

文件删除

func (*StoreClient) Upload

func (client *StoreClient) Upload(fileName string, file []byte) (string, error)

文件上传

Jump to

Keyboard shortcuts

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