mirror of
https://git.mirrors.martin98.com/https://github.com/ceph/ceph-csi.git
synced 2025-08-20 14:49:14 +08:00

Several packages are only used while running the e2e suite. These packages are less important to update, as the they can not influence the final executable that is part of the Ceph-CSI container-image. By moving these dependencies out of the main Ceph-CSI go.mod, it is easier to identify if a reported CVE affects Ceph-CSI, or only the testing (like most of the Kubernetes CVEs). Signed-off-by: Niels de Vos <ndevos@ibm.com>
41 lines
1.1 KiB
Go
41 lines
1.1 KiB
Go
// Copyright The OpenTelemetry Authors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
package telemetry
|
|
|
|
// For the semantics of status codes see
|
|
// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/api.md#set-status
|
|
type StatusCode int32
|
|
|
|
const (
|
|
// The default status.
|
|
StatusCodeUnset StatusCode = 0
|
|
// The Span has been validated by an Application developer or Operator to
|
|
// have completed successfully.
|
|
StatusCodeOK StatusCode = 1
|
|
// The Span contains an error.
|
|
StatusCodeError StatusCode = 2
|
|
)
|
|
|
|
var statusCodeStrings = []string{
|
|
"Unset",
|
|
"OK",
|
|
"Error",
|
|
}
|
|
|
|
func (s StatusCode) String() string {
|
|
if s >= 0 && int(s) < len(statusCodeStrings) {
|
|
return statusCodeStrings[s]
|
|
}
|
|
return "<unknown telemetry.StatusCode>"
|
|
}
|
|
|
|
// The Status type defines a logical error model that is suitable for different
|
|
// programming environments, including REST APIs and RPC APIs.
|
|
type Status struct {
|
|
// A developer-facing human readable error message.
|
|
Message string `json:"message,omitempty"`
|
|
// The status code.
|
|
Code StatusCode `json:"code,omitempty"`
|
|
}
|