-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add S3ByteArrayFetching as a guiding alias
- Loading branch information
Showing
3 changed files
with
32 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
aws-s3/base/src/main/scala/com/gu/etagcaching/aws/s3/S3ObjectFetchingUsing.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package com.gu.etagcaching.aws.s3 | ||
|
||
trait S3ObjectFetchingUsing[AWSClient] { | ||
def byteArrayWith(awsClient: AWSClient): S3ByteArrayFetching | ||
} |
18 changes: 18 additions & 0 deletions
18
aws-s3/base/src/main/scala/com/gu/etagcaching/aws/s3/package.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.gu.etagcaching.aws | ||
|
||
import com.gu.etagcaching.fetching.Fetching | ||
|
||
package object s3 { | ||
/** | ||
* To get an instance of `S3ByteArrayFetching`, add "com.gu.etag-caching" %% "aws-s3-sdk-v2" | ||
* as a dependency, then: | ||
* | ||
* {{{ | ||
* import com.gu.etagcaching.aws.sdkv2.s3.S3ObjectFetching | ||
* | ||
* val s3AsyncClient: software.amazon.awssdk.services.s3.S3AsyncClient = ??? // use AWS SDK v2 | ||
* val s3Fetching: S3ByteArrayFetching = S3ObjectFetching.byteArrayWith(s3AsyncClient) | ||
* }}} | ||
*/ | ||
type S3ByteArrayFetching = Fetching[ObjectId, Array[Byte]] | ||
} |