From 3fb3cfd1a59acc036793744507be07a177030b63 Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Mon, 2 Nov 2020 18:17:15 +0300 Subject: [PATCH] [#186] sdk/netmap: Use JSON placement policy converters in SDK Signed-off-by: Alex Vanin --- pkg/netmap/policy.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkg/netmap/policy.go b/pkg/netmap/policy.go index 3a3e45a0..3ed5cc30 100644 --- a/pkg/netmap/policy.go +++ b/pkg/netmap/policy.go @@ -11,3 +11,11 @@ type Filter = netmap.Filter type Replica = netmap.Replica type Clause = netmap.Clause type Operation = netmap.Operation + +func PlacementPolicyToJSON(p *PlacementPolicy) ([]byte, error) { + return netmap.PlacementPolicyToJSON(p) +} + +func PlacementPolicyFromJSON(data []byte) (*PlacementPolicy, error) { + return netmap.PlacementPolicyFromJSON(data) +}