forked from TrueCloudLab/frostfs-sdk-go
[#83] client: Implement status library
Define base `Status` interface. Provide the functionality to distinguish success and failure returns. Provide functionality to transport statuses over NeoFS API V2 protocol. Support success `OK` and failure `INTERNAL` returns. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
fc18ca2cb3
commit
9dcff95a29
20 changed files with 475 additions and 210 deletions
18
client/status/unrecognized.go
Normal file
18
client/status/unrecognized.go
Normal file
|
@ -0,0 +1,18 @@
|
|||
package apistatus
|
||||
|
||||
import (
|
||||
"github.com/nspcc-dev/neofs-api-go/v2/status"
|
||||
)
|
||||
|
||||
type unrecognizedStatusV2 struct {
|
||||
v2 status.Status
|
||||
}
|
||||
|
||||
func (x unrecognizedStatusV2) Error() string {
|
||||
return errMessageStatusV2("unrecognized", x.v2.Message())
|
||||
}
|
||||
|
||||
// implements method of the FromStatusV2 local interface.
|
||||
func (x *unrecognizedStatusV2) fromStatusV2(st *status.Status) {
|
||||
x.v2 = *st
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue