httputil

package
v0.0.0-...-6d13c91 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTimeoutMessage

func GetTimeoutMessage() []byte

GetTimeoutMessage returns ErrorResponse with status code 408 and message "timeout"

func RespondWithError

func RespondWithError(ctx context.Context, w http.ResponseWriter, status int, err error)

RespondWithError sends error response with the provided status code and error message

Types

type Detail

type Detail struct {
	Message    string `json:"message"`
	Subaccount string `json:"subaccount"`
	LocationID string `json:"locationId"`
}

Detail contains error details for scc

type DetailedError

type DetailedError struct {
	Code    int      `json:"code"`
	Message string   `json:"message"`
	Details []Detail `json:"details"`
}

DetailedError indicates partial processing failure of on-premise systems

func (DetailedError) Error

func (d DetailedError) Error() string

type Error

type Error struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

Error indicates processing failure of on-premise systems

func (Error) Error

func (e Error) Error() string

type ErrorResponse

type ErrorResponse struct {
	Error error `json:"error"`
}

ErrorResponse on failed notification service request

func (*ErrorResponse) UnmarshalJSON

func (e *ErrorResponse) UnmarshalJSON(b []byte) error

UnmarshalJSON implements Unmarshaler interface. The method unmarshal the data from b into ErrorResponse structure.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL