Documentation
¶
Index ¶
Constants ¶
View Source
const ( CodeAuthError = "auth_error" CodeValidationError = "validation_error" CodeNotFound = "not_found" CodeRateLimited = "rate_limited" CodeAPIError = "api_error" CodeConfirmationRequired = "confirmation_required" CodeConfirmationInvalid = "confirmation_invalid" CodeIdempotencyConflict = "idempotency_conflict" CodeNetworkError = "network_error" CodeUnknownError = "unknown_error" )
Variables ¶
This section is empty.
Functions ¶
func FormatUSDMinor ¶
func MaskAccountNumber ¶
func RFC3339OrEmpty ¶
Types ¶
type Envelope ¶
type Envelope struct {
OK bool `json:"ok"`
RequestID string `json:"request_id,omitempty"`
Data any `json:"data,omitempty"`
Error *ErrorDetail `json:"error,omitempty"`
}
func Fail ¶
func Fail(err *ErrorDetail, requestID string) Envelope
type ErrorDetail ¶
type ErrorDetail struct {
Code string `json:"code"`
Message string `json:"message"`
Details map[string]any `json:"details,omitempty"`
Fields []FieldError `json:"fields,omitempty"`
Retryable bool `json:"retryable,omitempty"`
}
func NewError ¶
func NewError(code, message string, details map[string]any, retryable bool) *ErrorDetail
func (*ErrorDetail) Error ¶
func (e *ErrorDetail) Error() string
type FieldError ¶
Click to show internal directories.
Click to hide internal directories.