Documentation
¶
Overview ¶
Package googlecloud Google Cloud存储服务实现 提供Google Cloud Storage的存储接口实现
Index ¶
- type Client
- func (client Client) Delete(path string) error
- func (client Client) Get(path string) (file *os.File, err error)
- func (client Client) GetEndpoint() string
- func (client Client) GetStream(path string) (io.ReadCloser, error)
- func (client Client) GetURL(path string) (url string, err error)
- func (client Client) List(path string) ([]*oss.Object, error)
- func (client Client) Put(urlPath string, reader io.Reader) (*oss.Object, error)
- func (client Client) ToRelativePath(urlPath string) string
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { // Config 客户端配置信息 Config *Config // BucketHandle 存储桶句柄 BucketHandle *storage.BucketHandle }
Client Google Cloud存储客户端 封装Google Cloud Storage的操作接口
func New ¶
New 初始化Google Cloud存储客户端 参数:
- config: Google Cloud配置信息
返回:
- *Client: Google Cloud存储客户端实例
- error: 错误信息
func (Client) GetStream ¶
func (client Client) GetStream(path string) (io.ReadCloser, error)
GetStream 获取指定路径文件的流 参数:
- path: 文件路径
返回:
- io.ReadCloser: 可读流
- error: 错误信息
func (Client) Put ¶
Put 上传文件到指定路径 参数:
- urlPath: 目标路径
- reader: 文件内容读取器
返回:
- *oss.Object: 上传后的对象信息
- error: 错误信息
Click to show internal directories.
Click to hide internal directories.