2020-10-19 18:27:38 +00:00
|
|
|
package netmap
|
|
|
|
|
|
|
|
import (
|
|
|
|
netmap "github.com/nspcc-dev/neofs-api-go/v2/netmap/grpc"
|
2021-11-16 17:30:55 +00:00
|
|
|
"github.com/nspcc-dev/neofs-api-go/v2/rpc/message"
|
2020-10-19 18:27:38 +00:00
|
|
|
)
|
|
|
|
|
2020-11-13 08:45:59 +00:00
|
|
|
func (p *PlacementPolicy) MarshalJSON() ([]byte, error) {
|
2021-03-12 12:57:23 +00:00
|
|
|
return message.MarshalJSON(p)
|
2020-11-13 08:45:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (p *PlacementPolicy) UnmarshalJSON(data []byte) error {
|
2021-03-12 12:57:23 +00:00
|
|
|
return message.UnmarshalJSON(p, data, new(netmap.PlacementPolicy))
|
2020-11-13 08:45:59 +00:00
|
|
|
}
|
2020-10-19 18:27:38 +00:00
|
|
|
|
2020-11-13 08:45:59 +00:00
|
|
|
func (f *Filter) MarshalJSON() ([]byte, error) {
|
2021-03-12 12:57:23 +00:00
|
|
|
return message.MarshalJSON(f)
|
2020-10-19 18:27:38 +00:00
|
|
|
}
|
|
|
|
|
2020-11-13 08:45:59 +00:00
|
|
|
func (f *Filter) UnmarshalJSON(data []byte) error {
|
2021-03-12 12:57:23 +00:00
|
|
|
return message.UnmarshalJSON(f, data, new(netmap.Filter))
|
2020-11-13 08:45:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Selector) MarshalJSON() ([]byte, error) {
|
2021-03-12 12:57:23 +00:00
|
|
|
return message.MarshalJSON(s)
|
2020-11-13 08:45:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Selector) UnmarshalJSON(data []byte) error {
|
2021-03-12 12:57:23 +00:00
|
|
|
return message.UnmarshalJSON(s, data, new(netmap.Selector))
|
2020-10-19 18:27:38 +00:00
|
|
|
}
|
2020-10-29 17:13:07 +00:00
|
|
|
|
2020-11-13 08:45:59 +00:00
|
|
|
func (r *Replica) MarshalJSON() ([]byte, error) {
|
2021-03-12 12:57:23 +00:00
|
|
|
return message.MarshalJSON(r)
|
2020-11-13 08:45:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (r *Replica) UnmarshalJSON(data []byte) error {
|
2021-03-12 12:57:23 +00:00
|
|
|
return message.UnmarshalJSON(r, data, new(netmap.Replica))
|
2020-10-29 17:13:07 +00:00
|
|
|
}
|
|
|
|
|
2020-11-13 08:45:59 +00:00
|
|
|
func (a *Attribute) MarshalJSON() ([]byte, error) {
|
2021-03-12 12:57:23 +00:00
|
|
|
return message.MarshalJSON(a)
|
2020-11-13 08:45:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (a *Attribute) UnmarshalJSON(data []byte) error {
|
2021-03-12 12:57:23 +00:00
|
|
|
return message.UnmarshalJSON(a, data, new(netmap.NodeInfo_Attribute))
|
2020-11-13 08:45:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (ni *NodeInfo) MarshalJSON() ([]byte, error) {
|
2021-03-12 12:57:23 +00:00
|
|
|
return message.MarshalJSON(ni)
|
2020-11-13 08:45:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (ni *NodeInfo) UnmarshalJSON(data []byte) error {
|
2021-03-12 12:57:23 +00:00
|
|
|
return message.UnmarshalJSON(ni, data, new(netmap.NodeInfo))
|
2020-10-29 17:13:07 +00:00
|
|
|
}
|
2021-02-17 17:32:23 +00:00
|
|
|
|
|
|
|
func (i *NetworkInfo) MarshalJSON() ([]byte, error) {
|
2021-03-12 12:57:23 +00:00
|
|
|
return message.MarshalJSON(i)
|
2021-02-17 17:32:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (i *NetworkInfo) UnmarshalJSON(data []byte) error {
|
2021-03-12 12:57:23 +00:00
|
|
|
return message.UnmarshalJSON(i, data, new(netmap.NetworkInfo))
|
2021-02-17 17:32:23 +00:00
|
|
|
}
|