status

package
v2.16.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 14, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Section_name = map[int32]string{
		0: "SECTION_SUCCESS",
		1: "SECTION_FAILURE_COMMON",
		2: "SECTION_OBJECT",
		3: "SECTION_CONTAINER",
		4: "SECTION_SESSION",
	}
	Section_value = map[string]int32{
		"SECTION_SUCCESS":        0,
		"SECTION_FAILURE_COMMON": 1,
		"SECTION_OBJECT":         2,
		"SECTION_CONTAINER":      3,
		"SECTION_SESSION":        4,
	}
)

Enum value maps for Section.

View Source
var (
	Success_name = map[int32]string{
		0: "OK",
	}
	Success_value = map[string]int32{
		"OK": 0,
	}
)

Enum value maps for Success.

View Source
var (
	CommonFail_name = map[int32]string{
		0: "INTERNAL",
		1: "WRONG_MAGIC_NUMBER",
		2: "SIGNATURE_VERIFICATION_FAIL",
		3: "NODE_UNDER_MAINTENANCE",
	}
	CommonFail_value = map[string]int32{
		"INTERNAL":                    0,
		"WRONG_MAGIC_NUMBER":          1,
		"SIGNATURE_VERIFICATION_FAIL": 2,
		"NODE_UNDER_MAINTENANCE":      3,
	}
)

Enum value maps for CommonFail.

View Source
var (
	Object_name = map[int32]string{
		0: "ACCESS_DENIED",
		1: "OBJECT_NOT_FOUND",
		2: "LOCKED",
		3: "LOCK_NON_REGULAR_OBJECT",
		4: "OBJECT_ALREADY_REMOVED",
		5: "OUT_OF_RANGE",
	}
	Object_value = map[string]int32{
		"ACCESS_DENIED":           0,
		"OBJECT_NOT_FOUND":        1,
		"LOCKED":                  2,
		"LOCK_NON_REGULAR_OBJECT": 3,
		"OBJECT_ALREADY_REMOVED":  4,
		"OUT_OF_RANGE":            5,
	}
)

Enum value maps for Object.

View Source
var (
	Container_name = map[int32]string{
		0: "CONTAINER_NOT_FOUND",
		1: "EACL_NOT_FOUND",
	}
	Container_value = map[string]int32{
		"CONTAINER_NOT_FOUND": 0,
		"EACL_NOT_FOUND":      1,
	}
)

Enum value maps for Container.

View Source
var (
	Session_name = map[int32]string{
		0: "TOKEN_NOT_FOUND",
		1: "TOKEN_EXPIRED",
	}
	Session_value = map[string]int32{
		"TOKEN_NOT_FOUND": 0,
		"TOKEN_EXPIRED":   1,
	}
)

Enum value maps for Session.

View Source
var File_status_grpc_types_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type CommonFail

type CommonFail int32

Section of failed statuses independent of the operation.

const (
	// [**1024**] Internal server error, default failure. Not detailed.
	// If the server cannot match failed outcome to the code, it should
	// use this code.
	CommonFail_INTERNAL CommonFail = 0
	// [**1025**] Wrong magic of the NeoFS network.
	// Details:
	//   - [**0**] Magic number of the served NeoFS network (big-endian 64-bit
	//     unsigned integer).
	CommonFail_WRONG_MAGIC_NUMBER CommonFail = 1
	// [**1026**] Signature verification failure.
	CommonFail_SIGNATURE_VERIFICATION_FAIL CommonFail = 2
	// [**1027**] Node is under maintenance.
	CommonFail_NODE_UNDER_MAINTENANCE CommonFail = 3
)

func (CommonFail) Descriptor

func (CommonFail) Descriptor() protoreflect.EnumDescriptor

func (CommonFail) Enum

func (x CommonFail) Enum() *CommonFail

func (CommonFail) EnumDescriptor deprecated

func (CommonFail) EnumDescriptor() ([]byte, []int)

Deprecated: Use CommonFail.Descriptor instead.

func (CommonFail) Number

func (x CommonFail) Number() protoreflect.EnumNumber

func (CommonFail) String

func (x CommonFail) String() string

func (CommonFail) Type

type Container

type Container int32

Section of statuses for container-related operations.

const (
	// [**3072**] Container not found.
	Container_CONTAINER_NOT_FOUND Container = 0
	// [**3073**] eACL table not found.
	Container_EACL_NOT_FOUND Container = 1
)

func (Container) Descriptor

func (Container) Descriptor() protoreflect.EnumDescriptor

func (Container) Enum

func (x Container) Enum() *Container

func (Container) EnumDescriptor deprecated

func (Container) EnumDescriptor() ([]byte, []int)

Deprecated: Use Container.Descriptor instead.

func (Container) Number

func (x Container) Number() protoreflect.EnumNumber

func (Container) String

func (x Container) String() string

func (Container) Type

type Object

type Object int32

Section of statuses for object-related operations.

const (
	// [**2048**] Access denied by ACL.
	// Details:
	// - [**0**] Human-readable description (UTF-8 encoded string).
	Object_ACCESS_DENIED Object = 0
	// [**2049**] Object not found.
	Object_OBJECT_NOT_FOUND Object = 1
	// [**2050**] Operation rejected by the object lock.
	Object_LOCKED Object = 2
	// [**2051**] Locking an object with a non-REGULAR type rejected.
	Object_LOCK_NON_REGULAR_OBJECT Object = 3
	// [**2052**] Object has been marked deleted.
	Object_OBJECT_ALREADY_REMOVED Object = 4
	// [**2053**] Invalid range has been requested for an object.
	Object_OUT_OF_RANGE Object = 5
)

func (Object) Descriptor

func (Object) Descriptor() protoreflect.EnumDescriptor

func (Object) Enum

func (x Object) Enum() *Object

func (Object) EnumDescriptor deprecated

func (Object) EnumDescriptor() ([]byte, []int)

Deprecated: Use Object.Descriptor instead.

func (Object) Number

func (x Object) Number() protoreflect.EnumNumber

func (Object) String

func (x Object) String() string

func (Object) Type

func (Object) Type() protoreflect.EnumType

type Section

type Section int32

Section identifiers.

const (
	// Successful return codes.
	Section_SECTION_SUCCESS Section = 0
	// Failure codes regardless of the operation.
	Section_SECTION_FAILURE_COMMON Section = 1
	// Object service-specific errors.
	Section_SECTION_OBJECT Section = 2
	// Container service-specific errors.
	Section_SECTION_CONTAINER Section = 3
	// Session service-specific errors.
	Section_SECTION_SESSION Section = 4
)

func (Section) Descriptor

func (Section) Descriptor() protoreflect.EnumDescriptor

func (Section) Enum

func (x Section) Enum() *Section

func (Section) EnumDescriptor deprecated

func (Section) EnumDescriptor() ([]byte, []int)

Deprecated: Use Section.Descriptor instead.

func (Section) Number

func (x Section) Number() protoreflect.EnumNumber

func (Section) String

func (x Section) String() string

func (Section) Type

func (Section) Type() protoreflect.EnumType

type Session

type Session int32

Section of statuses for session-related operations.

const (
	// [**4096**] Token not found.
	Session_TOKEN_NOT_FOUND Session = 0
	// [**4097**] Token has expired.
	Session_TOKEN_EXPIRED Session = 1
)

func (Session) Descriptor

func (Session) Descriptor() protoreflect.EnumDescriptor

func (Session) Enum

func (x Session) Enum() *Session

func (Session) EnumDescriptor deprecated

func (Session) EnumDescriptor() ([]byte, []int)

Deprecated: Use Session.Descriptor instead.

func (Session) Number

func (x Session) Number() protoreflect.EnumNumber

func (Session) String

func (x Session) String() string

func (Session) Type

func (Session) Type() protoreflect.EnumType

type Status

type Status struct {

	// The status code
	Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`
	// Developer-facing error message
	Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
	// Data detailing the outcome of the operation. Must be unique by ID.
	Details []*Status_Detail `protobuf:"bytes,3,rep,name=details,proto3" json:"details,omitempty"`
	// contains filtered or unexported fields
}

Declares the general format of the status returns of the NeoFS RPC protocol. Status is present in all response messages. Each RPC of NeoFS protocol describes the possible outcomes and details of the operation.

Each status is assigned a one-to-one numeric code. Any unique result of an operation in NeoFS is unambiguously associated with the code value.

Numerical set of codes is split into 1024-element sections. An enumeration is defined for each section. Values can be referred to in the following ways:

* numerical value ranging from 0 to 4,294,967,295 (global code);

  • values from enumeration (local code). The formula for the ratio of the local code (`L`) of a defined section (`S`) to the global one (`G`): `G = 1024 * S + L`.

All outcomes are divided into successful and failed, which corresponds to the success or failure of the operation. The definition of success follows the semantics of RPC and the description of its purpose. The server must not attach code that is the opposite of the outcome type.

See the set of return codes in the description for calls.

Each status can carry a developer-facing error message. It should be a human readable text in English. The server should not transmit (and the client should not expect) useful information in the message. Field `details` should make the return more detailed.

func (*Status) Descriptor deprecated

func (*Status) Descriptor() ([]byte, []int)

Deprecated: Use Status.ProtoReflect.Descriptor instead.

func (*Status) GetCode

func (x *Status) GetCode() uint32

func (*Status) GetDetails

func (x *Status) GetDetails() []*Status_Detail

func (*Status) GetMessage

func (x *Status) GetMessage() string

func (*Status) ProtoMessage

func (*Status) ProtoMessage()

func (*Status) ProtoReflect

func (x *Status) ProtoReflect() protoreflect.Message

func (*Status) Reset

func (x *Status) Reset()

func (*Status) SetCode

func (x *Status) SetCode(v uint32)

SetCode sets code of the Status.

func (*Status) SetDetails

func (x *Status) SetDetails(v []*Status_Detail)

SetDetails sets details of the Status.

func (*Status) SetMessage

func (x *Status) SetMessage(v string)

SetMessage sets message about the Status.

func (*Status) String

func (x *Status) String() string

type Status_Detail

type Status_Detail struct {

	// Detail ID. The identifier is required to determine the binary format
	// of the detail and how to decode it.
	Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	// Binary status detail. Must follow the format associated with ID.
	// The possibility of missing a value must be explicitly allowed.
	Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

Return detail. It contains additional information that can be used to analyze the response. Each code defines a set of details that can be attached to a status. Client should not handle details that are not covered by the code.

func (*Status_Detail) Descriptor deprecated

func (*Status_Detail) Descriptor() ([]byte, []int)

Deprecated: Use Status_Detail.ProtoReflect.Descriptor instead.

func (*Status_Detail) GetId

func (x *Status_Detail) GetId() uint32

func (*Status_Detail) GetValue

func (x *Status_Detail) GetValue() []byte

func (*Status_Detail) ProtoMessage

func (*Status_Detail) ProtoMessage()

func (*Status_Detail) ProtoReflect

func (x *Status_Detail) ProtoReflect() protoreflect.Message

func (*Status_Detail) Reset

func (x *Status_Detail) Reset()

func (*Status_Detail) SetId

func (x *Status_Detail) SetId(v uint32)

SetId sets identifier of the Status_Detail.

func (*Status_Detail) SetValue

func (x *Status_Detail) SetValue(v []byte)

SetValue sets value of the Status_Detail.

func (*Status_Detail) String

func (x *Status_Detail) String() string

type Success

type Success int32

Section of NeoFS successful return codes.

const (
	// [**0**] Default success. Not detailed.
	// If the server cannot match successful outcome to the code, it should
	// use this code.
	Success_OK Success = 0
)

func (Success) Descriptor

func (Success) Descriptor() protoreflect.EnumDescriptor

func (Success) Enum

func (x Success) Enum() *Success

func (Success) EnumDescriptor deprecated

func (Success) EnumDescriptor() ([]byte, []int)

Deprecated: Use Success.Descriptor instead.

func (Success) Number

func (x Success) Number() protoreflect.EnumNumber

func (Success) String

func (x Success) String() string

func (Success) Type

func (Success) Type() protoreflect.EnumType

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL