Documentation
¶
Index ¶
- Constants
- func ToContext(ctx context.Context, client *Client) context.Context
- type Client
- func (c *Client) DeleteWithContext(ctx context.Context, filepath string) error
- func (c *Client) DownloadByURLWithContext(ctx context.Context, uri url.URL) ([]byte, error)
- func (c *Client) DownloadWithContext(ctx context.Context, filepath string) ([]byte, error)
- func (c *Client) Upload(filename string, data []byte, public bool) (*url.URL, error)
- func (c *Client) UploadWithContext(ctx context.Context, filepath string, data []byte, public bool) (*url.URL, error)
- type Configs
Constants ¶
View Source
const (
Name = "s3"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
Configs
// contains filtered or unexported fields
}
func FromContext ¶
func (*Client) DeleteWithContext ¶
func (*Client) DownloadByURLWithContext ¶
func (*Client) DownloadWithContext ¶
type Configs ¶
type Configs struct {
S3EndpointURL url.URL `env:"S3_ENDPOINT_URL,required"`
S3AccessKey string `env:"S3_ACCESS_KEY,required"`
S3SecretKey string `env:"S3_SECRET_KEY,required"`
S3BucketName string `env:"S3_BUCKET_NAME,required"`
S3Timeout time.Duration `env:"S3_TIMEOUT" envDefault:"5s"`
S3MaxRetries int `env:"S3_MAX_RETRIES" envDefault:"3"`
S3BufferSize int `env:"S3_BUFFER_SIZE_KB" envDefault:"500"`
S3BufferGrowth float64 `env:"S3_BUFFER_GROWTH" envDefault:"1.8"`
}
Click to show internal directories.
Click to hide internal directories.