Documentation ¶
Index ¶
- Constants
- func IsBadRequest(err error) bool
- func IsConflict(err error) bool
- func IsExecutionError(err error) bool
- func IsForbidden(err error) bool
- func IsInternal(err error) bool
- func IsMethodNotAllowed(err error) bool
- func IsNotFound(err error) bool
- func IsPerr(err error) bool
- func IsPreconditionFailed(err error) bool
- func IsQuotaExceeded(err error) bool
- func IsServiceUnavailable(err error) bool
- func IsTimeout(err error) bool
- func IsTooManyRequests(err error) bool
- func IsUnauthorized(err error) bool
- func IsUserDefined(err error) bool
- type ErrorDetailModel
- type ErrorModel
- func AssociationExist(item string, associations string) ErrorModel
- func BadRequest(itemType string, id string) ErrorModel
- func BadRequestWithMessage(msg string) ErrorModel
- func BadRequestWithTypeAndMessage(errorType string, msg string) ErrorModel
- func Conflict(itemType string, id string) ErrorModel
- func ConflictWithMessage(msg string) ErrorModel
- func ExecutionError(itemType string, id string) ErrorModel
- func ExecutionErrorWithMessage(msg string) ErrorModel
- func ExecutionErrorWithTypeAndMessage(errorType string, msg string) ErrorModel
- func Forbidden() ErrorModel
- func ForbiddenWithMessage(msg string) ErrorModel
- func FromHttpError(err error, statusCode int) ErrorModel
- func Internal(err error) ErrorModel
- func InternalWithMessage(msg string) ErrorModel
- func InternalWithMessageAndType(errorType string, msg string) ErrorModel
- func MembershipExist(item string, associations string) ErrorModel
- func MethodNotAllowed() ErrorModel
- func MethodNotAllowedWithMessage(msg string) ErrorModel
- func NotFound(itemType string, id string) ErrorModel
- func NotFoundWithMessage(msg string) ErrorModel
- func NotFoundWithMessageAndType(errorType string, msg string) ErrorModel
- func PreconditionFailed(expected string) ErrorModel
- func PreconditionFailedWithMessage(msg string) ErrorModel
- func QuotaExceeded(itemType string, max int) ErrorModel
- func QuotaExceededWithMessage(msg string) ErrorModel
- func ServiceUnavailable() ErrorModel
- func ServiceUnavailableWithMessage(msg string) ErrorModel
- func Timeout(itemType string, id string) ErrorModel
- func TimeoutWithMessage(msg string) ErrorModel
- func TooManyRequests(itemType string, id string) ErrorModel
- func TooManyRequestsWithMessage(msg string) ErrorModel
- func TooManyRequestsWithTypeAndMessage(errorType string, msg string) ErrorModel
- func Unauthorized() ErrorModel
- func UnauthorizedWithMessage(msg string) ErrorModel
- func UnsupportedPlanValue(itemType, value string) ErrorModel
- func UnsupportedPlanValueWithMessage(msg string) ErrorModel
- func UserDefined(itemType string, id string) ErrorModel
- func UserDefinedWithMessage(msg string) ErrorModel
- func UserDefinedWithTypeAndMessage(errorType string, msg string) ErrorModel
- type Frame
- type StackTrace
- type ValidationError
Constants ¶
const ( ErrorCodeBadRequest = "error_bad_request" ErrorCodeInvalidData = "error_invalid_data" ErrorCodeDependencyFailure = "error_dependency_failure" )
const ( ErrorCodeExecutionError = "error_execution" StatusExecutionError = 460 )
const ( ErrorCodeInternal = "error_internal" ErrorCodeInternalTokenTooLarge = "error_internal_token_too_large" ErrorCodeJsonSyntaxError = "error_json_syntax_error" )
const ( ErrorCodeNotFound = "error_not_found" ErrorCodeTriggerDisabled = "error_trigger_disabled" )
const ( ErrorCodeQuotaExceeded = "error_quota_exceeded" ErrorCodeAssociationExists = "association_exists" ErrorCodeWorkspaceMembershipExists = "workspace_membership_exists" )
const ( ErrorCodeUserDefined = "error_user_defined" StatusUserDefined = 461 )
const (
ErrorCodeConflict = "error_conflict"
)
const (
ErrorCodeForbidden = "error_forbidden"
)
const (
ErrorCodeMethodNotAllowed = "not_allowed"
)
const (
ErrorCodePreconditionFailed = "error_precondition_failed"
)
const (
ErrorCodeRequestTimeout = "error_request_timeout"
)
const (
)const (
ErrorCodeTooManyRequests = "error_too_many_requests"
)
const (
)const (
ErrorCodeUnsupportedPlanValue = "error_unsupported_plan_value"
)
Variables ¶
This section is empty.
Functions ¶
func IsBadRequest ¶
func IsConflict ¶
func IsExecutionError ¶
func IsForbidden ¶
func IsInternal ¶
func IsMethodNotAllowed ¶
func IsNotFound ¶
func IsPreconditionFailed ¶
func IsQuotaExceeded ¶
func IsServiceUnavailable ¶
func IsTooManyRequests ¶
func IsUnauthorized ¶
func IsUserDefined ¶
Types ¶
type ErrorDetailModel ¶
type ErrorDetailModel struct { Message string `json:"message"` Location string `json:"location,omitempty"` }
As per RFC7807 (https://tools.ietf.org/html/rfc7807) define a standard error model with a limited set of Flowpipe-specific extensions Initial inspiration taken from https://github.com/danielgtaylor/huma/blob/master/error.go
type ErrorModel ¶
type ErrorModel struct { Instance string `json:"instance" binding:"required"` ID string `json:"-"` Type string `json:"type" binding:"required"` Title string `json:"title" binding:"required"` Status int `json:"status" binding:"required"` // If we don't have required it comes out as pointer and there is a bug in the formatter Detail string `json:"detail" binding:"required"` ValidationErrors []*ErrorDetailModel `json:"validation_errors,omitempty"` }
func AssociationExist ¶
func AssociationExist(item string, associations string) ErrorModel
func BadRequest ¶
func BadRequest(itemType string, id string) ErrorModel
func BadRequestWithMessage ¶
func BadRequestWithMessage(msg string) ErrorModel
func BadRequestWithTypeAndMessage ¶
func BadRequestWithTypeAndMessage(errorType string, msg string) ErrorModel
func Conflict ¶
func Conflict(itemType string, id string) ErrorModel
func ConflictWithMessage ¶
func ConflictWithMessage(msg string) ErrorModel
func ExecutionError ¶
func ExecutionError(itemType string, id string) ErrorModel
func ExecutionErrorWithMessage ¶
func ExecutionErrorWithMessage(msg string) ErrorModel
func ExecutionErrorWithTypeAndMessage ¶
func ExecutionErrorWithTypeAndMessage(errorType string, msg string) ErrorModel
func Forbidden ¶
func Forbidden() ErrorModel
func ForbiddenWithMessage ¶
func ForbiddenWithMessage(msg string) ErrorModel
func FromHttpError ¶
func FromHttpError(err error, statusCode int) ErrorModel
func Internal ¶
func Internal(err error) ErrorModel
func InternalWithMessage ¶
func InternalWithMessage(msg string) ErrorModel
func InternalWithMessageAndType ¶
func InternalWithMessageAndType(errorType string, msg string) ErrorModel
func MembershipExist ¶
func MembershipExist(item string, associations string) ErrorModel
func MethodNotAllowed ¶
func MethodNotAllowed() ErrorModel
func MethodNotAllowedWithMessage ¶
func MethodNotAllowedWithMessage(msg string) ErrorModel
func NotFound ¶
func NotFound(itemType string, id string) ErrorModel
func NotFoundWithMessage ¶
func NotFoundWithMessage(msg string) ErrorModel
func NotFoundWithMessageAndType ¶ added in v0.2.0
func NotFoundWithMessageAndType(errorType string, msg string) ErrorModel
func PreconditionFailed ¶
func PreconditionFailed(expected string) ErrorModel
func PreconditionFailedWithMessage ¶
func PreconditionFailedWithMessage(msg string) ErrorModel
func QuotaExceeded ¶
func QuotaExceeded(itemType string, max int) ErrorModel
func QuotaExceededWithMessage ¶
func QuotaExceededWithMessage(msg string) ErrorModel
func ServiceUnavailable ¶
func ServiceUnavailable() ErrorModel
func ServiceUnavailableWithMessage ¶
func ServiceUnavailableWithMessage(msg string) ErrorModel
func Timeout ¶
func Timeout(itemType string, id string) ErrorModel
func TimeoutWithMessage ¶
func TimeoutWithMessage(msg string) ErrorModel
func TooManyRequests ¶
func TooManyRequests(itemType string, id string) ErrorModel
func TooManyRequestsWithMessage ¶
func TooManyRequestsWithMessage(msg string) ErrorModel
func TooManyRequestsWithTypeAndMessage ¶
func TooManyRequestsWithTypeAndMessage(errorType string, msg string) ErrorModel
func Unauthorized ¶
func Unauthorized() ErrorModel
func UnauthorizedWithMessage ¶
func UnauthorizedWithMessage(msg string) ErrorModel
func UnsupportedPlanValue ¶
func UnsupportedPlanValue(itemType, value string) ErrorModel
func UnsupportedPlanValueWithMessage ¶
func UnsupportedPlanValueWithMessage(msg string) ErrorModel
func UserDefined ¶
func UserDefined(itemType string, id string) ErrorModel
func UserDefinedWithMessage ¶
func UserDefinedWithMessage(msg string) ErrorModel
func UserDefinedWithTypeAndMessage ¶
func UserDefinedWithTypeAndMessage(errorType string, msg string) ErrorModel
func (ErrorModel) Error ¶
func (e ErrorModel) Error() string
func (ErrorModel) GetStatus ¶
func (e ErrorModel) GetStatus() int
type Frame ¶
type Frame uintptr
Frame represents a program counter inside a stack frame. For historical reasons if Frame is interpreted as a uintptr its value represents the program counter + 1.
func (Frame) Format ¶
Format formats the frame according to the fmt.Formatter interface.
%s source file %d source line %n function name %v equivalent to %s:%d
Format accepts flags that alter the printing of some verbs, as follows:
%+s function name and path of source file relative to the compile time GOPATH separated by \n\t (<funcname>\n\t<path>) %+v equivalent to %+s:%d
func (Frame) MarshalText ¶
MarshalText formats a stacktrace Frame as a text string. The output is the same as that of fmt.Sprintf("%+v", f), but without newlines or tabs.
type StackTrace ¶
type StackTrace []Frame
StackTrace is stack of Frames from innermost (newest) to outermost (oldest).
func (StackTrace) Format ¶
func (st StackTrace) Format(s fmt.State, verb rune)
Format formats the stack of Frames according to the fmt.Formatter interface.
%s lists source files for each Frame in the stack %v lists the source file and line number for each Frame in the stack
Format accepts flags that alter the printing of some verbs, as follows:
%+v Prints filename, function, and line number for each Frame in the stack.
type ValidationError ¶
type ValidationError struct { Type string `json:"type"` // Denotes the location where the validation error was encountered. Errors validator.ValidationErrors `json:"errors"` // The list of validation errors. }
func (ValidationError) Error ¶
func (e ValidationError) Error() string