36 lines
481 B
Go
36 lines
481 B
Go
package minio
|
|
|
|
import (
|
|
"errors"
|
|
|
|
"github.com/minio/minio-go/v7"
|
|
)
|
|
|
|
type Config struct {
|
|
Endpoint string
|
|
AccessKey string
|
|
SecretKey string
|
|
UseSSL bool
|
|
}
|
|
|
|
func (c Config) validate() error {
|
|
if c.Endpoint == "" {
|
|
return errors.New("missing endpoint")
|
|
}
|
|
|
|
if c.AccessKey == "" {
|
|
return errors.New("missing access key")
|
|
}
|
|
|
|
if c.SecretKey == "" {
|
|
return errors.New("missing secret key")
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
type Client struct {
|
|
client *minio.Client
|
|
cfg Config
|
|
}
|