Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bucket ¶
type Bucket struct { ID string Name string // 桶名称 Provider string // 驱动名称 EndpointDN string BucketDN string Credential string Driver Driver Ext map[string]string }
Bucket 表示对某个具体存储桶的配置
type Connection ¶
type Connection interface { io.Closer Check() error GetObject(name string) Object GetBucketName() string }
Connection 表示与某个具体存储桶的连接
type Driver ¶
type Driver interface { GetConnector() Connector // 从 properties 中加载 bucket 的参数 GetBucket(tag, id string, p collection.Properties) (*Bucket, error) }
Driver 表示为某种存储方案提供的的驱动
type DriverRegistration ¶
DriverRegistration 用来表示某个驱动的注册信息
type DriverRegistry ¶
type DriverRegistry interface {
ListDrivers() []*DriverRegistration
}
DriverRegistry 用来枚举供应商提供的驱动 【inject:".buckets.Driver"】
type HTTPUploading ¶ added in v0.1.1
type HTTPUploading struct { UseHTTPS bool Method string URL string ContentType string ContentLength int64 ContentMD5 util.Hex MaxAge int64 // in seconds RequestHeaders map[string]string }
HTTPUploading ...
type Manager ¶
type Manager interface { FindDriver(name string) (Driver, error) OpenBucket(b *Bucket) (Connection, error) GetBucket(tag, id string, p collection.Properties) (*Bucket, error) }
Manager 用来统一管理各种驱动的管理器 【inject:"#buckets.Manager"】
type Object ¶
type Object interface { Exists() (bool, error) GetDownloadURL() string GetMeta() (*ObjectMeta, error) GetName() string UpdateMeta(meta *ObjectMeta) error GetEntity() (ObjectEntity, error) PutEntity(entity ObjectEntity, meta *ObjectMeta) error PutFile(file fs.Path, meta *ObjectMeta) error // UploadByAPI 准备上传参数; // 输入:待准备的参数; // 输出:已经准备好的参数; UploadByAPI(up *HTTPUploading) (*HTTPUploading, error) }
Object 表示对一个对象的引用
type ObjectEntity ¶
type ObjectEntity interface { GetSize() int64 Open() (io.ReadCloser, error) }
ObjectEntity 表示对象的实体
func NewEntityForBytes ¶
func NewEntityForBytes(b []byte) (ObjectEntity, error)
NewEntityForBytes ...
func NewEntityForFile ¶
func NewEntityForFile(file fs.Path) (ObjectEntity, error)
NewEntityForFile ...
func NewEntityForFileName ¶
func NewEntityForFileName(filename string) (ObjectEntity, error)
NewEntityForFileName ...
Click to show internal directories.
Click to hide internal directories.