2021-11-16 21:15:56 +03:00
|
|
|
package apistatus
|
|
|
|
|
|
|
|
// Status defines a variety of NeoFS API status returns.
|
|
|
|
//
|
|
|
|
// All statuses are split into two disjoint subsets: successful and failed, and:
|
2022-08-24 17:17:40 +03:00
|
|
|
// - statuses that implement the build-in error interface are considered failed statuses;
|
|
|
|
// - all other value types are considered successes (nil is a default success).
|
2021-11-16 21:15:56 +03:00
|
|
|
//
|
2023-05-22 16:07:57 +04:00
|
|
|
// In Go code type of success can be determined by a type switch, failure - by a switch with [errors.As] calls.
|
2021-11-16 21:15:56 +03:00
|
|
|
// Nil should be considered as a success, and default switch section - as an unrecognized Status.
|
|
|
|
//
|
|
|
|
// It should be noted that using direct typecasting is not a compatible approach.
|
|
|
|
//
|
2023-05-22 16:07:57 +04:00
|
|
|
// To transport statuses using the NeoFS API V2 protocol, see [StatusV2] interface and [FromStatusV2] and [ToStatusV2] functions.
|
2023-04-18 12:28:25 +04:00
|
|
|
type Status any
|