forked from TrueCloudLab/frostfs-api-go
Add v2
version to go module name
Replace all elements from `v2` to root directory. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
2d70391e31
commit
25da5d2e13
267 changed files with 116 additions and 17991 deletions
62
netmap/json.go
Normal file
62
netmap/json.go
Normal file
|
@ -0,0 +1,62 @@
|
|||
package netmap
|
||||
|
||||
import (
|
||||
netmap "github.com/nspcc-dev/neofs-api-go/v2/netmap/grpc"
|
||||
"github.com/nspcc-dev/neofs-api-go/v2/rpc/message"
|
||||
)
|
||||
|
||||
func (p *PlacementPolicy) MarshalJSON() ([]byte, error) {
|
||||
return message.MarshalJSON(p)
|
||||
}
|
||||
|
||||
func (p *PlacementPolicy) UnmarshalJSON(data []byte) error {
|
||||
return message.UnmarshalJSON(p, data, new(netmap.PlacementPolicy))
|
||||
}
|
||||
|
||||
func (f *Filter) MarshalJSON() ([]byte, error) {
|
||||
return message.MarshalJSON(f)
|
||||
}
|
||||
|
||||
func (f *Filter) UnmarshalJSON(data []byte) error {
|
||||
return message.UnmarshalJSON(f, data, new(netmap.Filter))
|
||||
}
|
||||
|
||||
func (s *Selector) MarshalJSON() ([]byte, error) {
|
||||
return message.MarshalJSON(s)
|
||||
}
|
||||
|
||||
func (s *Selector) UnmarshalJSON(data []byte) error {
|
||||
return message.UnmarshalJSON(s, data, new(netmap.Selector))
|
||||
}
|
||||
|
||||
func (r *Replica) MarshalJSON() ([]byte, error) {
|
||||
return message.MarshalJSON(r)
|
||||
}
|
||||
|
||||
func (r *Replica) UnmarshalJSON(data []byte) error {
|
||||
return message.UnmarshalJSON(r, data, new(netmap.Replica))
|
||||
}
|
||||
|
||||
func (a *Attribute) MarshalJSON() ([]byte, error) {
|
||||
return message.MarshalJSON(a)
|
||||
}
|
||||
|
||||
func (a *Attribute) UnmarshalJSON(data []byte) error {
|
||||
return message.UnmarshalJSON(a, data, new(netmap.NodeInfo_Attribute))
|
||||
}
|
||||
|
||||
func (ni *NodeInfo) MarshalJSON() ([]byte, error) {
|
||||
return message.MarshalJSON(ni)
|
||||
}
|
||||
|
||||
func (ni *NodeInfo) UnmarshalJSON(data []byte) error {
|
||||
return message.UnmarshalJSON(ni, data, new(netmap.NodeInfo))
|
||||
}
|
||||
|
||||
func (i *NetworkInfo) MarshalJSON() ([]byte, error) {
|
||||
return message.MarshalJSON(i)
|
||||
}
|
||||
|
||||
func (i *NetworkInfo) UnmarshalJSON(data []byte) error {
|
||||
return message.UnmarshalJSON(i, data, new(netmap.NetworkInfo))
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue