package codes
import "go.opentelemetry.io/otel/codes"
Package codes defines the canonical error codes used by OpenTelemetry.
This package is currently in a Release Candidate phase. Backwards incompatible changes may be introduced prior to v1.0.0, but we believe the current API is ready to stabilize.
It conforms to [the OpenTelemetry specification](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/api.md#statuscanonicalcode).
Index ¶
Types ¶
type Code ¶
type Code uint32
Code is an 32-bit representation of a status state.
const ( // Unset is the default status code. Unset Code = 0 // Error indicates the operation contains an error. Error Code = 1 // Ok indicates operation has been validated by an Application developers // or Operator to have completed successfully, or contain no error. Ok Code = 2 )
func (*Code) MarshalJSON ¶
MarshalJSON returns c as the JSON encoding of c.
func (Code) String ¶
String returns the Code as a string.
func (*Code) UnmarshalJSON ¶
UnmarshalJSON unmarshals b into the Code.
This is based on the functionality in the gRPC codes package: https://github.com/grpc/grpc-go/blob/bb64fee312b46ebee26be43364a7a966033521b1/codes/codes.go#L218-L244
Source Files ¶
codes.go doc.go
- Version
- v1.0.0-RC2
- Published
- Jul 26, 2021
- Platform
- windows/amd64
- Imports
- 3 packages
- Last checked
- 6 minutes ago –
Tools for package owners.