Documentation
¶
Index ¶
- type Client
- func (s *Client) Bucket() *string
- func (s *Client) Client() *s3.S3
- func (s *Client) Delete(key string) error
- func (s *Client) GetDownloadURL(key string, fileName string) (string, error)
- func (s *Client) Read(key string) ([]byte, error)
- func (s *Client) Session() *session.Session
- func (s *Client) Upload(key, fileName string, body io.Reader) error
- type Interface
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) GetDownloadURL ¶
type Interface ¶
type Interface interface {
//read the content, caller should close the io.ReadCloser.
Read(key string) ([]byte, error)
// Upload uploads a object to storage and returns object location if succeeded
Upload(key, fileName string, body io.Reader) error
GetDownloadURL(key string, fileName string) (string, error)
// Delete deletes an object by its key
Delete(key string) error
}
func NewS3Client ¶
type Options ¶
type Options struct {
Endpoint string `json:"endpoint,omitempty" yaml:"endpoint"`
Region string `json:"region,omitempty" yaml:"region"`
DisableSSL bool `json:"disableSSL" yaml:"disableSSL"`
ForcePathStyle bool `json:"forcePathStyle" yaml:"forcePathStyle"`
AccessKeyID string `json:"accessKeyID,omitempty" yaml:"accessKeyID"`
SecretAccessKey string `json:"secretAccessKey,omitempty" yaml:"secretAccessKey"`
SessionToken string `json:"sessionToken,omitempty" yaml:"sessionToken"`
Bucket string `json:"bucket,omitempty" yaml:"bucket"`
}
Options contains configuration to access a s3 service
func NewS3Options ¶
func NewS3Options() *Options
NewS3Options creates a default disabled Options(empty endpoint)
func (*Options) AddFlags ¶
AddFlags add options flags to command line flags, if s3-endpoint if left empty, following options will be ignored
Click to show internal directories.
Click to hide internal directories.