Define `WrongMagicNumber` type for which encapsulates the work with
incorrect network magic. Provide method to read/write the correct magic
(which is a status detail in NeoFS API V2 protocol).
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
In the latest NeoFS protocol update, each request is provided with a
network magic number. We have to provide the ability to set it on
the client.
Add `WithNetworkMagic` option constructor which accepts magic number.
Write the number to meta header of the all requests.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Downgrade `gomock` dependency to `v1.5.0` in order to import latest SDK
library to `neo-go`. Later version `v1.6.0` upgrades `golang
.org/x/tools` module which break Neo Go compiler (see neo-go#2086).
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Create `subnet` package. Define `ID` type of subnet identifiers.
Implement encoding and support NeoFS API V2 protocol. Provide method to
init instance from integer. Implement function which checks if `ID`
instance refers to zero subnet.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
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>