[#140] client: Specify status errors of Client methods

Extend docs with supported status returns. Add several helper functions
which allow to check the particular status.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2022-02-28 13:56:46 +03:00 committed by LeL
parent 12aa7ae144
commit 2a0b7b6b40
8 changed files with 87 additions and 10 deletions

View file

@ -172,7 +172,8 @@ func (x *ResContainerGet) setContainer(cnr *container.Container) {
// Context is required and must not be nil. It is used for network communication.
//
// Return statuses:
// - global (see Client docs).
// - global (see Client docs);
// - *apistatus.ContainerNotFound.
func (c *Client) ContainerGet(ctx context.Context, prm PrmContainerGet) (*ResContainerGet, error) {
switch {
case ctx == nil:
@ -479,7 +480,8 @@ func (x *ResContainerEACL) setTable(table *eacl.Table) {
// Context is required and must not be nil. It is used for network communication.
//
// Return statuses:
// - global (see Client docs).
// - global (see Client docs);
// - *apistatus.ContainerNotFound.
func (c *Client) ContainerEACL(ctx context.Context, prm PrmContainerEACL) (*ResContainerEACL, error) {
// check parameters
switch {