Implement `IsOwner` and `IDEquals` functions which check the
correspondence of the fields in `Info`. Remove no longer needed
`HasOwner` method of `Info`.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Create `subnet` package. Define `Info` type of the subnet info. Support
encoding and transport over the NeoFS API V2 protocol. Add methods to
work with identifier and owner.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
* Implement `NodeInfo.EnterSubnet` method which adds node's subnet.
* Implement `NodeInfo.IterateSubnets` which behaves similar to
eponymous function from neofs-api-go/v2.
* Implement `BelongsToSubnet` which checks if `NodeInfo` describes the
node belonging to a specific subnet.
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>
Make all `Client` methods to return structured values and error. Parse v2
status messages in all RPC and provide status getter from all result
structures. Returns status failures as status result instead of error.
Interface changes:
* all methods return `<method>Res` structure;
* rename some methods to be more clear;
* unify TZ and SHA256 objecy payload hashing in single method.
Behavior changes:
* client doesn't verify object header structure received via Object.Head.
If the caller was tied to verification, now it must do it explicitly.
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>
Change `Marshal` signature to `Marshal() ([]byte, error)`.
Dependency update in SDK itself should be done after moving client
as `pool` package has some dependent function signatures.
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
Another possible panic (though quite rare).
```
--- FAIL: TestTwoNodes (0.00s)
pool.go:185: Unexpected call to *pool.MockClient.EndpointInfo([context.Background.WithCancel.WithDeadline(2021-10-26 15:50:50.005585875 +0300 MSK m=+1.216577808 [-940.323µs])]) at /home/dzeta/repo/neofs-sdk-go/pool/pool.go:185 because: there are no expected calls of the method "EndpointInfo" for that receiver
pool.go:185: Unexpected call to *pool.MockClient.EndpointInfo([context.Background.WithCancel.WithDeadline(2021-10-26 15:50:50.005715623 +0300 MSK m=+1.216707547 [-1.351991ms])]) at /home/dzeta/repo/neofs-sdk-go/pool/pool.go:185 because: there are no expected calls of the method "EndpointInfo" for that receiver
```
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>