Documentation
¶
Index ¶
- Variables
- func HttpStatusCodeToGrpcCode(code int) codes.Code
- type ConfigError
- type EncryptionError
- type Error
- type NVError
- func (e *NVError) Error() string
- func (e *NVError) GRPCStatus() *status.Status
- func (e *NVError) GetMetadata(key string) string
- func (e *NVError) ID() string
- func (e *NVError) Metadata() map[string]string
- func (e *NVError) Origin() string
- func (e *NVError) Reason() string
- func (e *NVError) WithCode(code codes.Code) Error
- func (e *NVError) WithMetadata(md map[string]string) Error
- func (e *NVError) WithOrigin(origin string) Error
- func (e *NVError) WithReason(reason string) Error
- type NVErrorMarshaler
- func (c *NVErrorMarshaler) ContentType(v interface{}) string
- func (c *NVErrorMarshaler) Marshal(v interface{}) ([]byte, error)
- func (c *NVErrorMarshaler) NewDecoder(r io.Reader) runtime.Decoder
- func (c *NVErrorMarshaler) NewEncoder(w io.Writer) runtime.Encoder
- func (c *NVErrorMarshaler) Unmarshal(data []byte, v interface{}) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrBadConfig = fmt.Errorf("bad config") ErrInvalidConfig = fmt.Errorf("invalid config") ErrUninitializedConfig = fmt.Errorf("unintialized config") ErrBadCerts = fmt.Errorf("bad certs") ErrCertAndKeyRequired = fmt.Errorf("missing cert or key file when tls is enabled") ErrCertOrKeyFileMissing = fmt.Errorf("either both tls cert path and tls key path should be provided or none") ErrCACertRequired = fmt.Errorf("client-ca-cert-file must be provided") ErrBadTokenConfig = fmt.Errorf("bad token configuration") ErrJwtMissing = fmt.Errorf("missing jwt token") ErrJwtMissingKID = fmt.Errorf("jwt token missing kid header") ErrJwtWrongKey = fmt.Errorf("jwt key not found") ErrFetchingToken = fmt.Errorf("error fetching token") ErrPermissionDenied = fmt.Errorf("permission denied") ErrExceedMaxAllowedRetries = fmt.Errorf("exceed max allowed retries") ErrFailedToFetchJWK = fmt.Errorf("failed to fetch jwk") ErrEmptyEventsList = fmt.Errorf("the events list is empty") ErrEventsSizeExceedsLimit = fmt.Errorf("the total events size exceeds 1MB") ErrNegativeValue = fmt.Errorf("the value must not be negative") ErrNonPositiveValue = fmt.Errorf("the value must be positive") ErrExceedMaxBufferSize = fmt.Errorf("the size of the adding events exceeds max buffer size") ErrExceedMaxEventsListLength = fmt.Errorf("the size of the adding events exceeds max event list length") ErrEmptyCollectorID = fmt.Errorf("invalid metering config, collector id can not be empty") )
Functions ¶
func HttpStatusCodeToGrpcCode ¶
HttpStatusCodeToGrpcCode takes an int of a httpStatus and returns the closest grpc code
Types ¶
type ConfigError ¶
func (*ConfigError) Error ¶
func (c *ConfigError) Error() string
type EncryptionError ¶
type EncryptionError struct {
Err error `json:"-"` // Actual error
Message string `json:"message,omitempty"`
}
func ErrEncryptionFailed ¶
func ErrEncryptionFailed(err error, reason string) *EncryptionError
func ErrEncryptionKeyNotFound ¶
func ErrEncryptionKeyNotFound(keyId string) *EncryptionError
func ErrEncryptionKeySetMisconfigured ¶
func ErrEncryptionKeySetMisconfigured(reason string) *EncryptionError
func (*EncryptionError) Equal ¶
func (e *EncryptionError) Equal(err error) bool
func (*EncryptionError) Error ¶
func (e *EncryptionError) Error() string
type Error ¶
type Error interface {
error
WithCode(codes.Code) Error
WithReason(string) Error
WithOrigin(string) Error
WithMetadata(md map[string]string) Error
ID() string
Origin() string
Reason() string
Metadata() map[string]string
GetMetadata(key string) string
GRPCStatus() *status.Status
}
func NewNVError ¶
type NVError ¶
func (*NVError) GRPCStatus ¶
func (*NVError) GetMetadata ¶
func (*NVError) WithOrigin ¶
func (*NVError) WithReason ¶
type NVErrorMarshaler ¶
NVErrorMarshaler implements runtime.Marshaler. It finds if the error is of type NVError and marshals it to NVError type rather than the standard grpc_status.Status type
func (*NVErrorMarshaler) ContentType ¶
func (c *NVErrorMarshaler) ContentType(v interface{}) string
func (*NVErrorMarshaler) Marshal ¶
func (c *NVErrorMarshaler) Marshal(v interface{}) ([]byte, error)
Marshal overrides the format for NVError. If it's not NVError type, it falls back to standard definition.
func (*NVErrorMarshaler) NewDecoder ¶
func (c *NVErrorMarshaler) NewDecoder(r io.Reader) runtime.Decoder
func (*NVErrorMarshaler) NewEncoder ¶
func (c *NVErrorMarshaler) NewEncoder(w io.Writer) runtime.Encoder
func (*NVErrorMarshaler) Unmarshal ¶
func (c *NVErrorMarshaler) Unmarshal(data []byte, v interface{}) error
Click to show internal directories.
Click to hide internal directories.