Example #1
0
func (r *Route) MarshalJSON() ([]byte, error) {
	rt := route{
		Dst: ip.IPNet(r.Dst),
		GW:  r.GW,
	}

	return json.Marshal(rt)
}
Example #2
0
func (c *IPConfig) MarshalJSON() ([]byte, error) {
	ipc := ipConfig{
		IP:      ip.IPNet(c.IP),
		Gateway: c.Gateway,
		Routes:  c.Routes,
	}

	return json.Marshal(ipc)
}