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

implement JSONMarshal/JSONUnmarshal to provide the ability to store DAG #14

Merged
merged 1 commit into from
May 1, 2022

Conversation

yaoguais
Copy link
Contributor

Sometimes we have some requirements and need to serialize the DAG.
After serialization, we can store the DAG or transmit it on the network, which provides more usage scenarios for the dag library.

See func (d *DAG) AddVertex(v interface{}), which does not require that the vertex information passed in by the user must contain an id. Serializing the v parameter directly will lose the id information. Then I define a Vertexer interface, which contains the information of id and v.

The current unit tests have passed. Currently only JSON serialization is supported, and support for protobuf or msgpack can be added in the future to provide the ability to store or transmit binary data.

@sebogh
Copy link
Collaborator

sebogh commented Apr 23, 2022

Hi @yaoguais, thank you for the PR. I'll look at it!

@seboghpub seboghpub merged commit b87ee6a into heimdalr:master May 1, 2022
@seboghpub
Copy link
Collaborator

Hi @yaoguais, thank you for your contribution.

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.

None yet

3 participants