forked from TrueCloudLab/frostfs-node
[#481] Update frostfs-sdk-go and error pointer receivers
Signed-off-by: Alejandro Lopez <a.lopez@yadro.com>
This commit is contained in:
parent
de3d1eb99c
commit
5b7e4a51b7
77 changed files with 265 additions and 313 deletions
|
@ -32,11 +32,9 @@ func (x *Common) Init(state NodeState, nextHandler ServiceServer) {
|
|||
x.nextHandler = nextHandler
|
||||
}
|
||||
|
||||
var errMaintenance apistatus.NodeUnderMaintenance
|
||||
|
||||
func (x *Common) Get(req *objectV2.GetRequest, stream GetObjectStream) error {
|
||||
if x.state.IsMaintenance() {
|
||||
return errMaintenance
|
||||
return new(apistatus.NodeUnderMaintenance)
|
||||
}
|
||||
|
||||
return x.nextHandler.Get(req, stream)
|
||||
|
@ -44,7 +42,7 @@ func (x *Common) Get(req *objectV2.GetRequest, stream GetObjectStream) error {
|
|||
|
||||
func (x *Common) Put() (PutObjectStream, error) {
|
||||
if x.state.IsMaintenance() {
|
||||
return nil, errMaintenance
|
||||
return nil, new(apistatus.NodeUnderMaintenance)
|
||||
}
|
||||
|
||||
return x.nextHandler.Put()
|
||||
|
@ -52,7 +50,7 @@ func (x *Common) Put() (PutObjectStream, error) {
|
|||
|
||||
func (x *Common) Head(ctx context.Context, req *objectV2.HeadRequest) (*objectV2.HeadResponse, error) {
|
||||
if x.state.IsMaintenance() {
|
||||
return nil, errMaintenance
|
||||
return nil, new(apistatus.NodeUnderMaintenance)
|
||||
}
|
||||
|
||||
return x.nextHandler.Head(ctx, req)
|
||||
|
@ -60,7 +58,7 @@ func (x *Common) Head(ctx context.Context, req *objectV2.HeadRequest) (*objectV2
|
|||
|
||||
func (x *Common) Search(req *objectV2.SearchRequest, stream SearchStream) error {
|
||||
if x.state.IsMaintenance() {
|
||||
return errMaintenance
|
||||
return new(apistatus.NodeUnderMaintenance)
|
||||
}
|
||||
|
||||
return x.nextHandler.Search(req, stream)
|
||||
|
@ -68,7 +66,7 @@ func (x *Common) Search(req *objectV2.SearchRequest, stream SearchStream) error
|
|||
|
||||
func (x *Common) Delete(ctx context.Context, req *objectV2.DeleteRequest) (*objectV2.DeleteResponse, error) {
|
||||
if x.state.IsMaintenance() {
|
||||
return nil, errMaintenance
|
||||
return nil, new(apistatus.NodeUnderMaintenance)
|
||||
}
|
||||
|
||||
return x.nextHandler.Delete(ctx, req)
|
||||
|
@ -76,7 +74,7 @@ func (x *Common) Delete(ctx context.Context, req *objectV2.DeleteRequest) (*obje
|
|||
|
||||
func (x *Common) GetRange(req *objectV2.GetRangeRequest, stream GetObjectRangeStream) error {
|
||||
if x.state.IsMaintenance() {
|
||||
return errMaintenance
|
||||
return new(apistatus.NodeUnderMaintenance)
|
||||
}
|
||||
|
||||
return x.nextHandler.GetRange(req, stream)
|
||||
|
@ -84,7 +82,7 @@ func (x *Common) GetRange(req *objectV2.GetRangeRequest, stream GetObjectRangeSt
|
|||
|
||||
func (x *Common) GetRangeHash(ctx context.Context, req *objectV2.GetRangeHashRequest) (*objectV2.GetRangeHashResponse, error) {
|
||||
if x.state.IsMaintenance() {
|
||||
return nil, errMaintenance
|
||||
return nil, new(apistatus.NodeUnderMaintenance)
|
||||
}
|
||||
|
||||
return x.nextHandler.GetRangeHash(ctx, req)
|
||||
|
@ -92,7 +90,7 @@ func (x *Common) GetRangeHash(ctx context.Context, req *objectV2.GetRangeHashReq
|
|||
|
||||
func (x *Common) PutSingle(ctx context.Context, req *objectV2.PutSingleRequest) (*objectV2.PutSingleResponse, error) {
|
||||
if x.state.IsMaintenance() {
|
||||
return nil, errMaintenance
|
||||
return nil, new(apistatus.NodeUnderMaintenance)
|
||||
}
|
||||
|
||||
return x.nextHandler.PutSingle(ctx, req)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue