Documentation ¶
Overview ¶
Package xobj 是为了创建一个统一的对象存储接口,以便切换存储服务之后可以不改业务代码 只需要修改配置内容和创建部分变量即可
Package xobj 是为了创建一个统一的对象存储接口,以便切换存储服务之后可以不改业务代码 只需要修改配置内容和创建部分变量即可
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { // 获取一个文件的 ReadCloser ,记得关闭它 Reader(key string) (io.ReadCloser, error) // 获取文件 Get(key string) ([]byte, error) // 是否存在 Exists(key string) (bool, error) // 存储文件,不会进行重复检查,注意 reader 必须会自己 EOF Put(key string, f io.Reader) error // 存储带类型的文件 PutFile(key, name, contentType string, f io.Reader, contentLength int) error // 删除文件 Delete(key string) error }
Client xobj client
Click to show internal directories.
Click to hide internal directories.