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

feature: stream infinite array #330

Open
ghost opened this issue Mar 22, 2022 · 2 comments
Open

feature: stream infinite array #330

ghost opened this issue Mar 22, 2022 · 2 comments

Comments

@ghost
Copy link

ghost commented Mar 22, 2022

Is your feature request related to a problem? Please describe.

Currently, there is no API call to unmarshal an infinite array into a stream (e.g. a channel) of messages.

Describe the solution you'd like

I would like to be able to unmarshal an infinite array one item at a time.

Describe alternatives you've considered

Don't use infinite arrays and simply write the items back to back into the file.

Additional context

Use case: audit logging for ContainerSSH

@fxamacker
Copy link
Owner

@janosdebugs Thanks for suggesting this. This feature would involve either
A. updating the API of decoder or
B. creating new decoder type to handle indefinite length array

To keep the API and implementation simple, I prefer "B" and maybe limit stream decoding so we don't have to use the same decoder to stream decode indefinite arrays along with other data types at the same level.

Do you need to decode regular CBOR data and stream decode indefinite array using the same decoder? Also, do you need to stream decode nested infinite length array?

@ghost
Copy link
Author

ghost commented May 1, 2022

At this time we have a simple message format that involves creating a single infinite array and message structures within. It would be nice if we could decode them as they go through the pipe. We have no need for nested infinite arrays, and we are happy to use a separate decoder for this purpose.

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

No branches or pull requests

1 participant