graph/encoding: move basic encoding API into new encoding package
Created by: kortschak
This is the first of two PRs to harmonise the graph encoding API. The next will change the Unmarshal
methods to be SetAttribute
. The API is still in flux.
@vladimir-ch @mewmew Please take a look.