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

Start work on an Object API for representing a remote cloud object #20

Merged
merged 5 commits into from
Nov 2, 2022

Conversation

quinnj
Copy link
Member

@quinnj quinnj commented Oct 21, 2022

No description provided.

src/object.jl Outdated Show resolved Hide resolved
import CloudBase: AbstractStore, CloudCredentials

struct Object{T <: AbstractStore, C <: Union{CloudCredentials, Nothing}}
store::T
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm guessing it might be worth store being concretely typed, since we're going to be dispatching on that often? I wonder if we should add conveniences like const S3Object = Object{AWS.Bucket}?

@quinnj
Copy link
Member Author

quinnj commented Oct 22, 2022

@Drvi, @nickrobinson251, this is ready for review on the object.jl file. I'm going to do some more cleanup in the other files, but I think the object.jl file is in a state that I liike.


Base.eof(x::IOObject) = x.pos > length(x.object)

function Base.readbytes!(x::IOObject, dest::AbstractVector{UInt8}, n::Integer=length(dest))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To have the same semantics as Base.readbytes!, we should grow the dest array as necessary to store the incomming bytes. Not that we rely on this in ChunkedCSV.

@quinnj quinnj merged commit 1cd9f39 into main Nov 2, 2022
@quinnj quinnj deleted the jq/object branch November 2, 2022 04:08
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.

3 participants