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

Can you add the ability to serialize the parsing results to local files and deserialize them from local files to parsed results? #15

Closed
nh-live opened this issue Sep 8, 2020 · 3 comments

Comments

@nh-live
Copy link

nh-live commented Sep 8, 2020

No description provided.

@nh-live nh-live changed the title Can you add the ability to serialize or deserialize the parsing results to local files? Can you add the ability to serialize the parsing results to local files and deserialize them from local files to parsed results? Sep 8, 2020
@sleepinggenius2
Copy link
Owner

I'm not sure that I completely understand the question. Once you have the parsed data, you're free to serialize (marshal) it into whatever format you see fit. For example, I know it works just fine with encoding/json. Deserializing (unmarshaling) should work just the same, but in reverse. Please provide more details about what you are expecting from the library in this respect.

@nh-live
Copy link
Author

nh-live commented Nov 22, 2020

After using gosmi, the parsed data is stored as a file, and the program will not need to re parse after restart, but read the saved parsed data file directly.

@sleepinggenius2
Copy link
Owner

I'm still not really sure what you are trying to accomplish. All the public data structures should be serializable in whatever format makes the most sense for your application (JSON, YAML, gob, etc.). The smi example includes dumping as JSON and my mib2go project provides a Go codegen option as well. Maintaining application state is a non-trivial task, which is outside of the scope of gosmi as a library, and something you will need to implement within your application.

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

2 participants