From 3353940554526899f502868b456a0549dc25132c Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Fri, 11 Aug 2023 10:33:06 +0300 Subject: [PATCH] [#121] client: Make PrmContainerEACL fields public Signed-off-by: Airat Arifullin --- client/container_eacl.go | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/client/container_eacl.go b/client/container_eacl.go index 8f8e651..2acde86 100644 --- a/client/container_eacl.go +++ b/client/container_eacl.go @@ -17,26 +17,31 @@ import ( // PrmContainerEACL groups parameters of ContainerEACL operation. type PrmContainerEACL struct { - prmCommonMeta + // FrostFS request X-Headers. + XHeaders []string - idSet bool - id cid.ID + ContainerID *cid.ID } // SetContainer sets identifier of the FrostFS container to read the eACL table. // Required parameter. +// +// Deprecated: Use PrmContainerEACL.ContainerID instead. func (x *PrmContainerEACL) SetContainer(id cid.ID) { - x.id = id - x.idSet = true + x.ContainerID = &id } func (x *PrmContainerEACL) buildRequest(c *Client) (*v2container.GetExtendedACLRequest, error) { - if !x.idSet { + if x.ContainerID == nil { return nil, errorMissingContainer } + if len(x.XHeaders)%2 != 0 { + return nil, errorInvalidXHeaders + } + var cidV2 refs.ContainerID - x.id.WriteToV2(&cidV2) + x.ContainerID.WriteToV2(&cidV2) reqBody := new(v2container.GetExtendedACLRequestBody) reqBody.SetContainerID(&cidV2)