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

	return json.Marshal(rt)
}
Exemplo n.º 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)
}