Skip to content

Commit

Permalink
file mode change
Browse files Browse the repository at this point in the history
  • Loading branch information
adranwit committed Jul 27, 2017
1 parent f5cff8f commit 3d3bd7c
Show file tree
Hide file tree
Showing 14 changed files with 16 additions and 8 deletions.
Empty file modified .travis.yml 100644 → 100755
Empty file.
Empty file modified storage/aws/config.go 100755 → 100644
Empty file.
10 changes: 9 additions & 1 deletion storage/aws/service.go
Expand Up @@ -134,7 +134,6 @@ func (s *service) Download(object storage.Object) (io.Reader, error) {
if err != nil {
return nil, err
}

config, err := s.getAwsConfig()
if err != nil {
return nil, err
Expand Down Expand Up @@ -204,3 +203,12 @@ func (s *service) Register(schema string, service storage.Service) error {
func NewService(config *Config) storage.Service {
return &service{config: config}
}

//NewService creates a new aws storage service
func NewServiceWithCredential(credentials string) (storage.Service, error) {
config, err := NewConfig("file://" + credentials)
if err != nil {
return nil, err
}
return NewService(config), nil
}
Empty file modified storage/gs/object.go 100644 → 100755
Empty file.
14 changes: 7 additions & 7 deletions storage/gs/service.go 100644 → 100755
Expand Up @@ -120,13 +120,13 @@ func (s *service) Upload(URL string, reader io.Reader) error {
Object(name).
NewWriter(context.Background())

//expiry := parsedUrl.Query().Get("expiry")
//fmt.Printf("expiry :%v\n", expiry )
//if expiry != "" {
// writer.Metadata = map[string]string{
// "Cache-Control": "private, max-age=" + expiry,
// }
//}

expiry := parsedUrl.Query().Get("expiry")
if expiry != "" {
writer.Metadata = map[string]string{
"Cache-Control": "private, max-age=" + expiry,
}
}

io.Copy(writer, reader)
return writer.Close()
Expand Down
Empty file modified storage/object.go 100644 → 100755
Empty file.
Empty file modified storage/service.go 100644 → 100755
Empty file.
Empty file modified storage/service_test.go 100644 → 100755
Empty file.
Empty file modified storage/test/dir/file.json 100644 → 100755
Empty file.
Empty file modified storage/test/file1.txt 100644 → 100755
Empty file.
Empty file modified storage/test/file2.txt 100644 → 100755
Empty file.
Empty file modified test/config.json 100644 → 100755
Empty file.
Empty file modified test/corrupted_config.json 100644 → 100755
Empty file.
Empty file modified writer_at_test.go 100644 → 100755
Empty file.

0 comments on commit 3d3bd7c

Please sign in to comment.