Documentation
¶
Index ¶
- Variables
- type APIError
- type BucketCreated
- type BucketInfo
- type BucketList
- type Client
- func (c *Client) BucketExists(ctx context.Context, name string) (bool, error)
- func (c *Client) CreateBucket(ctx context.Context, name string) (*BucketCreated, error)
- func (c *Client) CreateBucketIfNotExists(ctx context.Context, name string) (*BucketCreated, error)
- func (c *Client) CreatePresignedURL(ctx context.Context, request CreatePresignedURLRequest) (*PresignedURL, error)
- func (c *Client) DeleteBucket(ctx context.Context, name string) error
- func (c *Client) DeleteObject(ctx context.Context, bucket, key string) error
- func (c *Client) DeletePresignedURL(ctx context.Context, token string) error
- func (c *Client) GetObject(ctx context.Context, bucket, key string) (*ObjectBody, error)
- func (c *Client) GetPresignedURL(ctx context.Context, token string) (*PresignedURL, error)
- func (c *Client) HeadObject(ctx context.Context, bucket, key string) (*ObjectMetadata, error)
- func (c *Client) ListBuckets(ctx context.Context) (*BucketList, error)
- func (c *Client) ListObjects(ctx context.Context, bucket string, options ListObjectsOptions) (*ObjectList, error)
- func (c *Client) ListPresignedURLs(ctx context.Context) (*PresignedURLList, error)
- func (c *Client) ObjectExists(ctx context.Context, bucket, key string) (bool, error)
- func (c *Client) PresignObjectURL(method, bucket, key string, expiresAt time.Time) (string, error)
- func (c *Client) PutObject(ctx context.Context, bucket, key string, body []byte) (*ObjectCreated, error)
- func (c *Client) PutObjectReader(ctx context.Context, bucket, key string, body io.Reader) (*ObjectCreated, error)
- type CommonPrefix
- type Config
- type CreatePresignedURLRequest
- type ListObjectsOptions
- type ObjectBody
- type ObjectCreated
- type ObjectInfo
- type ObjectList
- type ObjectMetadata
- type PresignedURL
- type PresignedURLList
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type APIError ¶
type BucketCreated ¶
type BucketInfo ¶
type BucketList ¶
type BucketList struct {
Buckets []BucketInfo `json:"buckets"`
Count int `json:"count"`
}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) BucketExists ¶
func (*Client) CreateBucket ¶
func (*Client) CreateBucketIfNotExists ¶
func (*Client) CreatePresignedURL ¶
func (c *Client) CreatePresignedURL(ctx context.Context, request CreatePresignedURLRequest) (*PresignedURL, error)
func (*Client) DeleteObject ¶
func (*Client) DeletePresignedURL ¶
func (*Client) GetPresignedURL ¶
func (*Client) HeadObject ¶
func (*Client) ListBuckets ¶
func (c *Client) ListBuckets(ctx context.Context) (*BucketList, error)
func (*Client) ListObjects ¶
func (c *Client) ListObjects(ctx context.Context, bucket string, options ListObjectsOptions) (*ObjectList, error)
func (*Client) ListPresignedURLs ¶
func (c *Client) ListPresignedURLs(ctx context.Context) (*PresignedURLList, error)
func (*Client) ObjectExists ¶
func (*Client) PresignObjectURL ¶
func (*Client) PutObjectReader ¶
type CommonPrefix ¶
type CommonPrefix struct {
Prefix string `json:"prefix"`
}
type ListObjectsOptions ¶
type ObjectBody ¶
type ObjectBody struct {
ObjectMetadata
Body []byte
}
type ObjectCreated ¶
type ObjectInfo ¶
type ObjectList ¶
type ObjectList struct {
Bucket string `json:"bucket"`
Prefix string `json:"prefix"`
Delimiter string `json:"delimiter,omitempty"`
MaxKeys int `json:"maxKeys"`
IsTruncated bool `json:"isTruncated"`
Contents []ObjectInfo `json:"contents"`
CommonPrefixes []CommonPrefix `json:"commonPrefixes,omitempty"`
}
type ObjectMetadata ¶
type PresignedURL ¶
type PresignedURL struct {
ID uint `json:"id,omitempty"`
Token string `json:"token"`
URL string `json:"url,omitempty"`
Bucket string `json:"bucket"`
Key string `json:"key"`
Method string `json:"method"`
ExpiresAt *time.Time `json:"expiresAt,omitempty"`
MaxDownloads *int `json:"maxDownloads,omitempty"`
DownloadCount int `json:"downloadCount,omitempty"`
CreatedBy string `json:"createdBy,omitempty"`
CreatedAt time.Time `json:"createdAt"`
Message string `json:"message,omitempty"`
}
type PresignedURLList ¶
type PresignedURLList struct {
URLs []PresignedURL `json:"urls"`
Count int `json:"count"`
}
Click to show internal directories.
Click to hide internal directories.