mirror of
https://github.com/dutchcoders/transfer.sh.git
synced 2024-12-27 04:40:19 +01:00
ISSUE-242 just some small refactoring
This commit is contained in:
parent
cc1a1b8487
commit
2cebb7520c
3 changed files with 4 additions and 4 deletions
|
@ -338,7 +338,7 @@ func New() *Cmd {
|
|||
panic("secret-key not set.")
|
||||
} else if bucket := c.String("bucket"); bucket == "" {
|
||||
panic("bucket not set.")
|
||||
} else if storage, err := server.NewS3Storage(accessKey, secretKey, bucket, c.String("s3-endpoint"), logger, c.Bool("s3-no-multipart"), c.String("s3-region")); err != nil {
|
||||
} else if storage, err := server.NewS3Storage(accessKey, secretKey, bucket, c.String("s3-region"), c.String("s3-endpoint"), logger, c.Bool("s3-no-multipart")); err != nil {
|
||||
panic(err)
|
||||
} else {
|
||||
options = append(options, server.UseStorage(storage))
|
||||
|
|
|
@ -132,8 +132,8 @@ type S3Storage struct {
|
|||
noMultipart bool
|
||||
}
|
||||
|
||||
func NewS3Storage(accessKey, secretKey, bucketName, endpoint string, logger *log.Logger, disableMultipart bool, region string) (*S3Storage, error) {
|
||||
sess := getAwsSession(accessKey, secretKey, endpoint, region)
|
||||
func NewS3Storage(accessKey, secretKey, bucketName, region, endpoint string, logger *log.Logger, disableMultipart bool) (*S3Storage, error) {
|
||||
sess := getAwsSession(accessKey, secretKey, region, endpoint)
|
||||
|
||||
return &S3Storage{bucket: bucketName, s3: s3.New(sess), session: sess, logger: logger, noMultipart: disableMultipart}, nil
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ import (
|
|||
"github.com/golang/gddo/httputil/header"
|
||||
)
|
||||
|
||||
func getAwsSession(accessKey, secretKey, endpoint string, region string) *session.Session {
|
||||
func getAwsSession(accessKey, secretKey, region, endpoint string) *session.Session {
|
||||
return session.Must(session.NewSession(&aws.Config{
|
||||
Region: aws.String(region),
|
||||
Endpoint: aws.String(endpoint),
|
||||
|
|
Loading…
Reference in a new issue