forked from TrueCloudLab/frostfs-sdk-go
[#189] client: Make PrmInit fields public for client
Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
This commit is contained in:
parent
ab75edd709
commit
e91d40e250
21 changed files with 55 additions and 46 deletions
|
@ -78,19 +78,19 @@ func (c *Client) prepareRequest(req request, meta *v2session.RequestMetaHeader)
|
|||
|
||||
meta.SetTTL(ttl)
|
||||
meta.SetVersion(verV2)
|
||||
meta.SetNetworkMagic(c.prm.netMagic)
|
||||
meta.SetNetworkMagic(c.prm.NetMagic)
|
||||
|
||||
req.SetMetaHeader(meta)
|
||||
}
|
||||
|
||||
// processResponse verifies response signature and converts status to an error if needed.
|
||||
func (c *Client) processResponse(resp responseV2) (apistatus.Status, error) {
|
||||
if c.prm.cbRespInfo != nil {
|
||||
if c.prm.ResponseInfoCallback != nil {
|
||||
rmi := ResponseMetaInfo{
|
||||
key: resp.GetVerificationHeader().GetBodySignature().GetKey(),
|
||||
epoch: resp.GetMetaHeader().GetEpoch(),
|
||||
}
|
||||
if err := c.prm.cbRespInfo(rmi); err != nil {
|
||||
if err := c.prm.ResponseInfoCallback(rmi); err != nil {
|
||||
return nil, fmt.Errorf("response callback error: %w", err)
|
||||
}
|
||||
}
|
||||
|
@ -101,7 +101,7 @@ func (c *Client) processResponse(resp responseV2) (apistatus.Status, error) {
|
|||
}
|
||||
|
||||
st := apistatus.FromStatusV2(resp.GetMetaHeader().GetStatus())
|
||||
if !c.prm.disableFrostFSErrorResolution {
|
||||
if !c.prm.DisableFrostFSErrorResolution {
|
||||
return st, apistatus.ErrFromStatus(st)
|
||||
}
|
||||
return st, nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue