Documentation
¶
Overview ¶
Package api provides shared voice gateway API infrastructure.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Error ¶
type Error struct {
// Status is the HTTP status code.
Status int
// Code is the machine-readable error code.
Code ErrorCode
// Message is the client-facing error message.
Message string
// Details holds optional unstructured diagnostics.
Details map[string]any
// Cause is the optional underlying error.
Cause error
}
Error is a concrete error type with status code, error code, optional details, and optional wrapped error.
type ErrorDetails ¶
type ErrorDetails struct {
// Code is the machine-readable error code.
Code ErrorCode `json:"code"`
// Message is the human-readable error message.
Message string `json:"message"`
}
ErrorDetails holds the code and message within an error response.
type ErrorResponse ¶
type ErrorResponse struct {
// Error contains the machine-readable code and human-readable message.
Error ErrorDetails `json:"error"`
// Details contains optional endpoint-specific structured error context.
Details map[string]any `json:"details,omitempty"`
}
ErrorResponse is the JSON envelope for error responses.
type Validatable ¶
type Validatable interface {
Validate() error
}
Validatable is implemented by request types that can validate their fields.
Click to show internal directories.
Click to hide internal directories.