imageserver
imageserver copied to clipboard
Implements an S3 source.
The S3 credentials can be provided directly or in the environment. Fully composable and works excellently with the groupcache implementation. Admittedly plays loose with contexts. Resolves #26
In the groupcache example, swapping out testdata
and updating newServer()
, while taking a new CLI argument for awsS3bucket
works perfectly. If the S3 path would be s3://somebucket/food/20200809_0030_01.jpg
then http://localhost:8081/food/20200809_0030_01.jpg?&width=1024
would be example path. I can provide a full example if desirable. Happy to iterate on this for a while too if there is feedback.
func newServer() imageserver.Server {
srv, err := s3.NewS3Server(awsRegion, awsAccessKey, awsSecretKey, awsS3bucket)
if err != nil {
panic(err)
}
srv = newServerImage(srv)
srv = newServerGroupcache(srv)
return srv
}