forked from TrueCloudLab/frostfs-api-go
[#142] sdk/container: Use placement policy from neofs-api v2.0
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
parent
1cbfb337a7
commit
012cea1add
2 changed files with 14 additions and 5 deletions
|
@ -3,6 +3,7 @@ package container
|
|||
import (
|
||||
"github.com/google/uuid"
|
||||
"github.com/nspcc-dev/neofs-api-go/pkg/acl"
|
||||
"github.com/nspcc-dev/neofs-api-go/pkg/netmap"
|
||||
"github.com/nspcc-dev/neofs-api-go/pkg/owner"
|
||||
)
|
||||
|
||||
|
@ -18,7 +19,7 @@ type (
|
|||
|
||||
containerOptions struct {
|
||||
acl uint32
|
||||
policy string
|
||||
policy *netmap.PlacementPolicy
|
||||
attributes []attribute
|
||||
owner *owner.ID
|
||||
nonce uuid.UUID
|
||||
|
@ -91,9 +92,8 @@ func WithNEO3Wallet(w *owner.NEO3Wallet) NewOption {
|
|||
})
|
||||
}
|
||||
|
||||
func WithPolicy(policy string) NewOption {
|
||||
func WithPolicy(policy *netmap.PlacementPolicy) NewOption {
|
||||
return newFuncContainerOption(func(option *containerOptions) {
|
||||
// todo: make sanity check and store binary structure
|
||||
option.policy = policy
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue