1 Star 0 Fork 0

shishshinedone / clouds

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
public.go 1.19 KB
一键复制 编辑 原始数据 按行查看 历史
shishshinedone 提交于 2022-09-26 16:07 . clouds get
package clouds_core
import (
"errors"
"io"
"time"
"gitee.com/shishshinedone/coauth"
)
const (
VersionOriginal = "1"
)
var (
ErrExisted = errors.New("存储对象重名或已存在")
ErrNotExisted = errors.New("该存储对象不存在")
)
type Options struct {
Timeout time.Duration // client超时时间
Version string // 令牌版本
Region string // 存储区域
}
type Clouds interface {
Init() error
Add(objectName, subdirectory string, objectReader io.Reader) (CloudsAdd, error)
Del(objectName string) error
Get(objectName string) (io.ReadSeeker, error)
GetBytes(objectName string) ([]byte, error)
Stat(objectName string) (CloudsStat, error)
Find(objectNamePrefix string) ([]string, error)
List() ([]string, error)
Destroy() error
Tags(objectName string) (map[string]string, error)
DelTags(objectName string) error
SetTags(objectName string, tags map[string]string) (map[string]string, error)
}
type CloudsAdd interface {
Name() string
Size() int64
}
type CloudsStat interface {
Name() string
Size() int64
ModTime() time.Time
}
func NewClouds(addr, name string, auth coauth.Coauth, options *Options) Clouds {
return newClouds(addr, name, auth, options)
}
Go
1
https://gitee.com/shishshinedone/clouds.git
git@gitee.com:shishshinedone/clouds.git
shishshinedone
clouds
clouds
v1.0.11

搜索帮助