Documentation
¶
Index ¶
- Constants
- type Client
- func (c *Client) CreateBucket(bucket string) (int, error)
- func (c *Client) DeleteBucket(bucket string) (int, error)
- func (c *Client) DeleteObject(bucket, key string) (int, error)
- func (c *Client) DeleteObjects(bucket string, keys ...string) (*serverTypes.DeleteResult, int, error)
- func (c *Client) DoSigV4Request(method, rawURL string, body io.ReadCloser) (*http.Response, error)
- func (c *Client) GetObject(bucket, key string, writer io.Writer, progressCh chan<- types.Progress) (int, error)
- func (c *Client) HeadBucket(bucket string) (int, error)
- func (c *Client) HeadObject(bucket, key string) (*HeadObjectResponse, error)
- func (c *Client) IsDone() bool
- func (c *Client) ListBuckets() ([]types.Bucket, error)
- func (c *Client) ListObjects(bucket, key string, useV2 bool) <-chan ListResult
- func (c *Client) PutObject(bucket, key string, file *os.File, progressCh chan<- types.Progress) (int, error)
- type HeadObjectResponse
- type ListResult
- type SigV4ChunkEncoder
Constants ¶
View Source
const DefaultRegion = "eu-west-1"
View Source
const DefaultRequestTimeout = 1 * time.Minute
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
Ctx context.Context
Host string
Port uint16
AccessKey string
SecretKey string
TLS bool
ChunkSize int
// contains filtered or unexported fields
}
func NewS3Client ¶
func (*Client) DeleteObjects ¶
func (c *Client) DeleteObjects(bucket string, keys ...string) (*serverTypes.DeleteResult, int, error)
func (*Client) DoSigV4Request ¶
func (*Client) HeadObject ¶
func (c *Client) HeadObject(bucket, key string) (*HeadObjectResponse, error)
func (*Client) ListObjects ¶
func (c *Client) ListObjects(bucket, key string, useV2 bool) <-chan ListResult
type HeadObjectResponse ¶
type ListResult ¶
type ListResult struct {
Object *types.Object
CommonPrefix *types.CommonPrefix
Err error
}
func (*ListResult) IsCommonPrefix ¶
func (lr *ListResult) IsCommonPrefix() bool
func (*ListResult) IsObject ¶
func (lr *ListResult) IsObject() bool
type SigV4ChunkEncoder ¶
type SigV4ChunkEncoder struct {
Ctx context.Context
Src io.ReadCloser
DataSize int
TotalSize int
ChunkSize int
// contains filtered or unexported fields
}
func NewSigV4ChunkEncoder ¶
func NewSigV4ChunkEncoder( ctx context.Context, src io.ReadCloser, dataSize int, chunkSize int, progressCh chan<- client.Progress, ) *SigV4ChunkEncoder
func (*SigV4ChunkEncoder) Close ¶
func (enc *SigV4ChunkEncoder) Close() error
Click to show internal directories.
Click to hide internal directories.