Documentation
¶
Index ¶
- type Client
- type GetOptions
- type ListOptions
- type MinIOClient
- func (m *MinIOClient) Bucket() string
- func (m *MinIOClient) BucketExists(ctx context.Context) (bool, error)
- func (m *MinIOClient) CopyObject(ctx context.Context, srcKey, dstKey string, opts PutOptions) (ObjectInfo, error)
- func (m *MinIOClient) DeleteObject(ctx context.Context, key string) error
- func (m *MinIOClient) EnsureBucket(ctx context.Context) error
- func (m *MinIOClient) GetObject(ctx context.Context, key string, opts GetOptions) (io.ReadCloser, ObjectInfo, error)
- func (m *MinIOClient) ListObjects(ctx context.Context, opts ListOptions) ([]ObjectInfo, error)
- func (m *MinIOClient) PresignGet(ctx context.Context, key string, ttl time.Duration) (*url.URL, error)
- func (m *MinIOClient) PresignPut(ctx context.Context, key string, ttl time.Duration) (*url.URL, error)
- func (m *MinIOClient) PutObject(ctx context.Context, key string, body io.Reader, size int64, opts PutOptions) (ObjectInfo, error)
- func (m *MinIOClient) Raw() *minio.Client
- func (m *MinIOClient) StatObject(ctx context.Context, key string) (ObjectInfo, error)
- type MinIOConfig
- type ObjectInfo
- type Option
- type PutOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface {
Bucket() string
BucketExists(ctx context.Context) (bool, error)
EnsureBucket(ctx context.Context) error
PutObject(ctx context.Context, key string, body io.Reader, size int64, opts PutOptions) (ObjectInfo, error)
GetObject(ctx context.Context, key string, opts GetOptions) (io.ReadCloser, ObjectInfo, error)
DeleteObject(ctx context.Context, key string) error
StatObject(ctx context.Context, key string) (ObjectInfo, error)
ListObjects(ctx context.Context, opts ListOptions) ([]ObjectInfo, error)
CopyObject(ctx context.Context, srcKey, dstKey string, opts PutOptions) (ObjectInfo, error)
PresignPut(ctx context.Context, key string, ttl time.Duration) (*url.URL, error)
PresignGet(ctx context.Context, key string, ttl time.Duration) (*url.URL, error)
}
type GetOptions ¶
type ListOptions ¶
type MinIOClient ¶
type MinIOClient struct {
// contains filtered or unexported fields
}
func NewMinIO ¶
func NewMinIO(ctx context.Context, cfg MinIOConfig, opts ...Option) (*MinIOClient, error)
func (*MinIOClient) Bucket ¶
func (m *MinIOClient) Bucket() string
func (*MinIOClient) BucketExists ¶
func (m *MinIOClient) BucketExists(ctx context.Context) (bool, error)
func (*MinIOClient) CopyObject ¶
func (m *MinIOClient) CopyObject(ctx context.Context, srcKey, dstKey string, opts PutOptions) (ObjectInfo, error)
func (*MinIOClient) DeleteObject ¶
func (m *MinIOClient) DeleteObject(ctx context.Context, key string) error
func (*MinIOClient) EnsureBucket ¶
func (m *MinIOClient) EnsureBucket(ctx context.Context) error
func (*MinIOClient) GetObject ¶
func (m *MinIOClient) GetObject(ctx context.Context, key string, opts GetOptions) (io.ReadCloser, ObjectInfo, error)
func (*MinIOClient) ListObjects ¶
func (m *MinIOClient) ListObjects(ctx context.Context, opts ListOptions) ([]ObjectInfo, error)
func (*MinIOClient) PresignGet ¶
func (*MinIOClient) PresignPut ¶
func (*MinIOClient) PutObject ¶
func (m *MinIOClient) PutObject(ctx context.Context, key string, body io.Reader, size int64, opts PutOptions) (ObjectInfo, error)
func (*MinIOClient) Raw ¶
func (m *MinIOClient) Raw() *minio.Client
func (*MinIOClient) StatObject ¶
func (m *MinIOClient) StatObject(ctx context.Context, key string) (ObjectInfo, error)
type MinIOConfig ¶
type MinIOConfig struct {
Provider string `json:"provider" yaml:"provider"`
Endpoint string `json:"endpoint" yaml:"endpoint"`
AccessKey string `json:"access_key" yaml:"access_key"`
SecretKey string `json:"secret_key" yaml:"secret_key"`
SessionToken string `json:"session_token" yaml:"session_token"`
Bucket string `json:"bucket" yaml:"bucket"`
Region string `json:"region" yaml:"region"`
UseSSL bool `json:"use_ssl" yaml:"use_ssl"`
AutoCreateBucket bool `json:"auto_create_bucket" yaml:"auto_create_bucket"`
}
type ObjectInfo ¶
Click to show internal directories.
Click to hide internal directories.