-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathclient.go
More file actions
35 lines (30 loc) · 808 Bytes
/
client.go
File metadata and controls
35 lines (30 loc) · 808 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package storage
import (
"github.com/deis/builder/pkg/sys"
s3 "github.com/minio/minio-go"
)
type Client struct {
*s3.Client
Endpoint *Endpoint
}
// GetClient returns a S3 API compatible storage client
<<<<<<< 7c8dc9bdf6ffed171ed952661229ae2b8590cef7
func GetClient(regionStr string, fs sys.FS, env sys.Env) (*s3.Client, error) {
auth, err := getAuth(fs)
=======
func GetClient(regionStr string) (*Client, error) {
auth, err := getAuth()
>>>>>>> fix(pkg/gitreceive): create and use a storage.Client
if err != nil {
return nil, err
}
endpoint, err := getEndpoint(env)
if err != nil {
return nil, err
}
s3Client, err := s3.New(endpoint.URLStr, auth.accessKeyID, auth.accessKeySecret, false)
if err != nil {
return nil, err
}
return &Client{Client: s3Client, Endpoint: endpoint}, nil
}