forked from TrueCloudLab/frostfs-sdk-go
[#121] client: Make PrmContainerGet fields public
Signed-off-by: Airat Arifullin a.arifullin@yadro.com
This commit is contained in:
parent
363f153eaf
commit
d376302a3b
1 changed files with 14 additions and 9 deletions
|
@ -18,26 +18,31 @@ import (
|
|||
|
||||
// PrmContainerGet groups parameters of ContainerGet operation.
|
||||
type PrmContainerGet struct {
|
||||
prmCommonMeta
|
||||
// FrostFS request X-Headers
|
||||
XHeaders []string
|
||||
|
||||
idSet bool
|
||||
id cid.ID
|
||||
CID *cid.ID
|
||||
}
|
||||
|
||||
// SetContainer sets identifier of the container to be read.
|
||||
// Required parameter.
|
||||
func (x *PrmContainerGet) SetContainer(id cid.ID) {
|
||||
x.id = id
|
||||
x.idSet = true
|
||||
//
|
||||
// Deprecated: Use PrmContainerGet.CID instead.
|
||||
func (prm *PrmContainerGet) SetContainer(cid cid.ID) {
|
||||
prm.CID = &cid
|
||||
}
|
||||
|
||||
func (x *PrmContainerGet) buildRequest(c *Client) (*v2container.GetRequest, error) {
|
||||
if !x.idSet {
|
||||
func (prm *PrmContainerGet) buildRequest(c *Client) (*v2container.GetRequest, error) {
|
||||
if prm.CID == nil {
|
||||
return nil, errorMissingContainer
|
||||
}
|
||||
|
||||
if len(prm.XHeaders)%2 != 0 {
|
||||
return nil, errorInvalidXHeaders
|
||||
}
|
||||
|
||||
var cidV2 refs.ContainerID
|
||||
x.id.WriteToV2(&cidV2)
|
||||
prm.CID.WriteToV2(&cidV2)
|
||||
|
||||
reqBody := new(v2container.GetRequestBody)
|
||||
reqBody.SetContainerID(&cidV2)
|
||||
|
|
Loading…
Reference in a new issue