github.com/TrueCloudLab/frostfs-api-go/v2@v2.0.0-20230228134343-196241c4e79a/netmap/json.go (about)

     1  package netmap
     2  
     3  import (
     4  	netmap "github.com/TrueCloudLab/frostfs-api-go/v2/netmap/grpc"
     5  	"github.com/TrueCloudLab/frostfs-api-go/v2/rpc/message"
     6  )
     7  
     8  func (p *PlacementPolicy) MarshalJSON() ([]byte, error) {
     9  	return message.MarshalJSON(p)
    10  }
    11  
    12  func (p *PlacementPolicy) UnmarshalJSON(data []byte) error {
    13  	return message.UnmarshalJSON(p, data, new(netmap.PlacementPolicy))
    14  }
    15  
    16  func (f *Filter) MarshalJSON() ([]byte, error) {
    17  	return message.MarshalJSON(f)
    18  }
    19  
    20  func (f *Filter) UnmarshalJSON(data []byte) error {
    21  	return message.UnmarshalJSON(f, data, new(netmap.Filter))
    22  }
    23  
    24  func (s *Selector) MarshalJSON() ([]byte, error) {
    25  	return message.MarshalJSON(s)
    26  }
    27  
    28  func (s *Selector) UnmarshalJSON(data []byte) error {
    29  	return message.UnmarshalJSON(s, data, new(netmap.Selector))
    30  }
    31  
    32  func (r *Replica) MarshalJSON() ([]byte, error) {
    33  	return message.MarshalJSON(r)
    34  }
    35  
    36  func (r *Replica) UnmarshalJSON(data []byte) error {
    37  	return message.UnmarshalJSON(r, data, new(netmap.Replica))
    38  }
    39  
    40  func (a *Attribute) MarshalJSON() ([]byte, error) {
    41  	return message.MarshalJSON(a)
    42  }
    43  
    44  func (a *Attribute) UnmarshalJSON(data []byte) error {
    45  	return message.UnmarshalJSON(a, data, new(netmap.NodeInfo_Attribute))
    46  }
    47  
    48  func (ni *NodeInfo) MarshalJSON() ([]byte, error) {
    49  	return message.MarshalJSON(ni)
    50  }
    51  
    52  func (ni *NodeInfo) UnmarshalJSON(data []byte) error {
    53  	return message.UnmarshalJSON(ni, data, new(netmap.NodeInfo))
    54  }
    55  
    56  func (i *NetworkInfo) MarshalJSON() ([]byte, error) {
    57  	return message.MarshalJSON(i)
    58  }
    59  
    60  func (i *NetworkInfo) UnmarshalJSON(data []byte) error {
    61  	return message.UnmarshalJSON(i, data, new(netmap.NetworkInfo))
    62  }