Make PrmContainerEACL fields public #145
2 changed files with 18 additions and 12 deletions
|
@ -17,26 +17,31 @@ import (
|
||||||
|
|
||||||
// PrmContainerEACL groups parameters of ContainerEACL operation.
|
// PrmContainerEACL groups parameters of ContainerEACL operation.
|
||||||
type PrmContainerEACL struct {
|
type PrmContainerEACL struct {
|
||||||
prmCommonMeta
|
// FrostFS request X-Headers.
|
||||||
|
XHeaders []string
|
||||||
|
|
||||||
idSet bool
|
ContainerID *cid.ID
|
||||||
id cid.ID
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetContainer sets identifier of the FrostFS container to read the eACL table.
|
// SetContainer sets identifier of the FrostFS container to read the eACL table.
|
||||||
// Required parameter.
|
// Required parameter.
|
||||||
|
//
|
||||||
|
// Deprecated: Use PrmContainerEACL.ContainerID instead.
|
||||||
func (x *PrmContainerEACL) SetContainer(id cid.ID) {
|
func (x *PrmContainerEACL) SetContainer(id cid.ID) {
|
||||||
x.id = id
|
x.ContainerID = &id
|
||||||
x.idSet = true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *PrmContainerEACL) buildRequest(c *Client) (*v2container.GetExtendedACLRequest, error) {
|
func (x *PrmContainerEACL) buildRequest(c *Client) (*v2container.GetExtendedACLRequest, error) {
|
||||||
if !x.idSet {
|
if x.ContainerID == nil {
|
||||||
return nil, errorMissingContainer
|
return nil, errorMissingContainer
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(x.XHeaders)%2 != 0 {
|
||||||
|
return nil, errorInvalidXHeaders
|
||||||
|
}
|
||||||
|
|
||||||
var cidV2 refs.ContainerID
|
var cidV2 refs.ContainerID
|
||||||
x.id.WriteToV2(&cidV2)
|
x.ContainerID.WriteToV2(&cidV2)
|
||||||
|
|
||||||
reqBody := new(v2container.GetExtendedACLRequestBody)
|
reqBody := new(v2container.GetExtendedACLRequestBody)
|
||||||
reqBody.SetContainerID(&cidV2)
|
reqBody.SetContainerID(&cidV2)
|
||||||
|
|
11
pool/pool.go
11
pool/pool.go
|
@ -523,8 +523,9 @@ func (c *clientWrapper) containerEACL(ctx context.Context, prm PrmContainerEACL)
|
||||||
return eacl.Table{}, err
|
return eacl.Table{}, err
|
||||||
}
|
}
|
||||||
|
|
||||||
var cliPrm sdkClient.PrmContainerEACL
|
cliPrm := sdkClient.PrmContainerEACL{
|
||||||
cliPrm.SetContainer(prm.cnrID)
|
ContainerID: &prm.ContainerID,
|
||||||
|
}
|
||||||
|
|
||||||
start := time.Now()
|
start := time.Now()
|
||||||
res, err := cl.ContainerEACL(ctx, cliPrm)
|
res, err := cl.ContainerEACL(ctx, cliPrm)
|
||||||
|
@ -1521,12 +1522,12 @@ func (x *PrmContainerDelete) SetWaitParams(waitParams WaitParams) {
|
||||||
|
|
||||||
// PrmContainerEACL groups parameters of GetEACL operation.
|
// PrmContainerEACL groups parameters of GetEACL operation.
|
||||||
type PrmContainerEACL struct {
|
type PrmContainerEACL struct {
|
||||||
cnrID cid.ID
|
ContainerID cid.ID
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetContainerID specifies identifier of the FrostFS container to read the eACL table.
|
// SetContainerID specifies identifier of the FrostFS container to read the eACL table.
|
||||||
func (x *PrmContainerEACL) SetContainerID(cnrID cid.ID) {
|
func (x *PrmContainerEACL) SetContainerID(cnrID cid.ID) {
|
||||||
x.cnrID = cnrID
|
x.ContainerID = cnrID
|
||||||
}
|
}
|
||||||
|
|
||||||
// PrmContainerSetEACL groups parameters of SetEACL operation.
|
// PrmContainerSetEACL groups parameters of SetEACL operation.
|
||||||
|
@ -2514,7 +2515,7 @@ func waitForContainerPresence(ctx context.Context, cli client, cnrID cid.ID, wai
|
||||||
func waitForEACLPresence(ctx context.Context, cli client, cnrID *cid.ID, table *eacl.Table, waitParams *WaitParams) error {
|
func waitForEACLPresence(ctx context.Context, cli client, cnrID *cid.ID, table *eacl.Table, waitParams *WaitParams) error {
|
||||||
var prm PrmContainerEACL
|
var prm PrmContainerEACL
|
||||||
if cnrID != nil {
|
if cnrID != nil {
|
||||||
prm.SetContainerID(*cnrID)
|
prm.ContainerID = *cnrID
|
||||||
}
|
}
|
||||||
|
|
||||||
return waitFor(ctx, waitParams, func(ctx context.Context) bool {
|
return waitFor(ctx, waitParams, func(ctx context.Context) bool {
|
||||||
|
|
Loading…
Reference in a new issue