소스 검색

Changes according to CR

tags/v1.2.0
stefanbenten 4 년 전
부모
커밋
79c5130066
1개의 변경된 파일4개의 추가작업 그리고 10개의 파일을 삭제
  1. +4
    -10
      server/storage.go

+ 4
- 10
server/storage.go 파일 보기

@@ -613,7 +613,7 @@ func (s *StorjStorage) Type() string {
}

func (s *StorjStorage) Head(token string, filename string) (contentType string, contentLength uint64, err error) {
key := fmt.Sprintf("%s/%s", token, filename)
key := storj.JoinPaths(token, filename)

ctx := context.TODO()

@@ -628,7 +628,7 @@ func (s *StorjStorage) Head(token string, filename string) (contentType string,
}

func (s *StorjStorage) Get(token string, filename string) (reader io.ReadCloser, contentType string, contentLength uint64, err error) {
key := fmt.Sprintf("%s/%s", token, filename)
key := storj.JoinPaths(token, filename)
ctx := context.TODO()

obj, err := s.bucket.OpenObject(ctx, key)
@@ -642,7 +642,7 @@ func (s *StorjStorage) Get(token string, filename string) (reader io.ReadCloser,
}

func (s *StorjStorage) Delete(token string, filename string) (err error) {
key := fmt.Sprintf("%s/%s", token, filename)
key := storj.JoinPaths(token, filename)

ctx := context.TODO()

@@ -652,7 +652,7 @@ func (s *StorjStorage) Delete(token string, filename string) (err error) {
}

func (s *StorjStorage) Put(token string, filename string, reader io.Reader, contentType string, contentLength uint64) (err error) {
key := fmt.Sprintf("%s/%s", token, filename)
key := storj.JoinPaths(token, filename)

s.logger.Printf("Uploading file %s to S3 Bucket", filename)

@@ -664,9 +664,3 @@ func (s *StorjStorage) Put(token string, filename string, reader io.Reader, cont
}
return nil
}

func toStorjKey(key string) (newKey storj.Key) {
var encryptionKey storj.Key
copy(encryptionKey[:], []byte(key))
return encryptionKey
}

불러오는 중...
취소
저장