Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implements an S3 source. #28

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

cognusion
Copy link

@cognusion cognusion commented Nov 30, 2022

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
}

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AWS S3 support
1 participant