Skip to content

Instantly share code, notes, and snippets.

@johannesboyne
Created February 2, 2020 08:20
Show Gist options
  • Save johannesboyne/45534116551688c87a5a53ca91cca147 to your computer and use it in GitHub Desktop.
Save johannesboyne/45534116551688c87a5a53ca91cca147 to your computer and use it in GitHub Desktop.
$ docker run -it -p 9000:9000 johannesboyne/gofakes3
2020/02/01 20:51:06 locals3 db created or opened
2020/02/01 20:51:06 using port: 9000
2020/02/01 20:51:24 => /
2020/02/01 20:53:58 => /testbucket?list-type=2&prefix=&delimiter=%2F&encoding-type=url
2020/02/01 20:53:58 GET BUCKET
2020/02/01 20:53:58 bucketname: testbucket
2020/02/01 20:53:58 prefix :
2020/02/01 20:55:12 => /my-bucket
2020/02/01 20:55:12 CREATE BUCKET: my-bucket
2020/02/01 20:55:12 bucket created
2020/02/01 20:55:19 => /my-bucket?list-type=2&prefix=&delimiter=%2F&encoding-type=url
2020/02/01 20:55:19 GET BUCKET
2020/02/01 20:55:19 bucketname: my-bucket
2020/02/01 20:55:19 prefix :
2020/02/02 08:18:11 => /my-bucket/dir-1/points.geojson
2020/02/02 08:18:11 CREATE OBJECT: my-bucket dir-1/points.geojson
$ curl http://localhost:9000
<?xml version="1.0" encoding="UTF-8"?><ListAllMyBucketsResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<Owner>
<ID>fe7272ea58be830e56fe1663b10fafef</ID>
<DisplayName>GoFakeS3</DisplayName>
</Owner>
</ListAllMyBucketsResult>%
$ aws --no-verify-ssl --endpoint-url="http://localhost:9000" s3 ls s3://testbucket
#An error occurred (404) when calling the ListObjectsV2 operation: Not Found
$ aws s3api --no-verify-ssl --endpoint-url="http://localhost:9000" create-bucket --bucket my-bucket
{
"Location": "/my-bucket"
}
$ aws --no-verify-ssl --endpoint-url="http://localhost:9000" s3 ls s3://my-bucket
# no error
$ aws s3api --no-verify-ssl --endpoint-url="http://localhost:9000" put-object --bucket my-bucket --key dir-1/points.geojson --body points.geojson
{
"ETag": "\"fbacf535f27731c9771645a39863328\""
}
$ aws s3api --no-verify-ssl --endpoint-url="http://localhost:9000" get-object --bucket my-bucket --key dir-1/points.geojson returned_points.geojson
{
"LastModified": "Sun, 2 Feb 2020 08:19:50 UTC",
"ContentLength": 643505,
"ETag": "\"fe53fb2b9ab267eb7f3ffe3350d56b11\"",
"ContentType": "text/plain; charset=utf-8",
"Metadata": {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment