[new] list command
This commit is contained in:
26
util/minio.go
Normal file
26
util/minio.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package util
|
||||
|
||||
import (
|
||||
"github.com/minio/minio-go/v7"
|
||||
"github.com/minio/minio-go/v7/pkg/credentials"
|
||||
)
|
||||
|
||||
type S3 struct {
|
||||
Endpoint string
|
||||
AccessKeyID string
|
||||
SecretAccessKey string
|
||||
UseSSL bool
|
||||
Client *minio.Client
|
||||
}
|
||||
|
||||
func (s *S3) Init() error {
|
||||
var err error
|
||||
s.Client, err = minio.New(s.Endpoint, &minio.Options{
|
||||
Creds: credentials.NewStaticV4(s.AccessKeyID, s.SecretAccessKey, ""),
|
||||
Secure: s.UseSSL,
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
Reference in New Issue
Block a user