@patcito I won’t create a “gocloud” objectstorage implementation since gocloud is just a library to unify the API to access different object storages.
For example the current s3 objectstorage is implemented using the minio go client. But it could be reimplemented using the amazon s3 go api or gocloud.
So the right thing to do will be to create two new GCP and Azure objectstorages implementations that will share the same code using the gocloud api. And also the s3 objectstorage should use the same implementation instead of the minio go client.
Obviously to do this we should be sure that the gocloud api provides all the features and doesn’t introduce new bugs or regressions.
However, it’s not working yet because gocloud.dev does not implement io.Seek unfortunately but it does support something which I think is similar called NewRangeReader.
The minio go client automatically implements io.Seek. When using the gocloud API you should implement it by yourself:
- The first call to objectstorage.ReadObject will return an object that saves the Reader return from a call to NewRangeReader with a starting position of 0 and end of -1.
- Implement Seek on the above object to make it a ReadSeekCloser. When Seek is called you should close the current Reader provided by the call to NewRangeReader and create a new one using the provided starting offset/whence.