Documentation
¶
Index ¶
- Variables
- type Config
- type Credentials
- type Storage
- func (s *Storage) CheckBucket() error
- func (s *Storage) Close() error
- func (s *Storage) Conn() *minio.Client
- func (s *Storage) CreateBucket() error
- func (s *Storage) Delete(key string) error
- func (s *Storage) DeleteWithContext(ctx context.Context, key string) error
- func (s *Storage) Get(key string) ([]byte, error)
- func (s *Storage) GetWithContext(ctx context.Context, key string) ([]byte, error)
- func (s *Storage) RemoveBucket() error
- func (s *Storage) Reset() error
- func (s *Storage) ResetWithContext(ctx context.Context) error
- func (s *Storage) Set(key string, val []byte, exp time.Duration) error
- func (s *Storage) SetWithContext(ctx context.Context, key string, val []byte, exp time.Duration) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ConfigDefault = Config{ Bucket: "fiber-bucket", Endpoint: "", Region: "", Token: "", Secure: false, Reset: false, MaxRetry: minio.MaxRetry, Credentials: Credentials{}, GetObjectOptions: minio.GetObjectOptions{}, PutObjectOptions: minio.PutObjectOptions{}, ListObjectsOptions: minio.ListObjectsOptions{}, RemoveObjectOptions: minio.RemoveObjectOptions{}, }
ConfigDefault is the default config
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// Bucket
// Default fiber-bucket
Bucket string
// Endpoint is a host name or an IP address
Endpoint string
// Region Set this value to override region cache
// Optional
Region string
// Token Set this value to provide x-amz-security-token (AWS S3 specific)
// Optional, Default is false
Token string
// Secure If set to true, https is used instead of http.
// Default is false
Secure bool
// Reset clears any existing keys in existing Bucket
// Optional. Default is false
Reset bool
// The maximum number of times requests that encounter retryable failures should be attempted.
// Optional. Default is 10, same as the MinIO client.
MaxRetry int
// Credentials Minio access key and Minio secret key.
// Need to be defined
Credentials Credentials
// GetObjectOptions Options for GET requests specifying additional options like encryption, If-Match
GetObjectOptions minio.GetObjectOptions
// PutObjectOptions
// Allows user to set optional custom metadata, content headers, encryption keys and number of threads for multipart upload operation.
PutObjectOptions minio.PutObjectOptions
// ListObjectsOptions Options per to list objects
ListObjectsOptions minio.ListObjectsOptions
// RemoveObjectOptions Allows user to set options
RemoveObjectOptions minio.RemoveObjectOptions
}
Config defines the config for storage.
type Credentials ¶
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
Storage interface that is implemented by storage providers
func (*Storage) CheckBucket ¶
CheckBucket Check to see if bucket already exists
func (*Storage) CreateBucket ¶
CreateBucket Bucket not found so Make a new bucket
func (*Storage) DeleteWithContext ¶ added in v0.4.0
DeleteWithContext key with value with context
func (*Storage) GetWithContext ¶ added in v0.4.0
GetWithContext retrieves the value associated with the given key using the provided context.
func (*Storage) RemoveBucket ¶
RemoveBucket Bucket remove if bucket is empty
func (*Storage) ResetWithContext ¶ added in v0.4.0
ResetWithContext all keys with context
Click to show internal directories.
Click to hide internal directories.