Documentation ¶
Index ¶
- Variables
- type ErrorResponse
- func ConflictRequest(errorText string) *ErrorResponse
- func InvalidRequest(errorText string) *ErrorResponse
- func NewError(errorText string, errorCode int64) *ErrorResponse
- func NotFoundRequest(errorText string) *ErrorResponse
- func ServerError(errorText string) *ErrorResponse
- func TemporaryError(errorText string) *ErrorResponse
- func UnknownParam(paramName string) *ErrorResponse
Constants ¶
This section is empty.
Variables ¶
View Source
var CODE_CONFLICT_REQ int64 = 409
View Source
var CODE_INVALID_REQ int64 = 400
View Source
var CODE_NOT_FOUND int64 = 404
View Source
var CODE_SERVER_ERR int64 = 500
View Source
var CODE_SERVER_UNAVAILABLE int64 = 501
View Source
var CODE_TEMPORARY_ERROR int64 = 412
View Source
var ERR_ASYNC_PUSH = InvalidRequest("ASYNC must be used with SYNCWAIT")
View Source
var ERR_ASYNC_WAIT = InvalidRequest("ASYNC param can be used only if WAIT timeout greater than 0")
View Source
var ERR_CMD_PARAM_NOT_PROVIDED = InvalidRequest("At least one parameter should be provided")
View Source
var ERR_CMD_WITH_NO_PARAMS = InvalidRequest("Command doesn't accept any parameters")
View Source
var ERR_CONN_CLOSING = NewError("Connection will be closed soon", CODE_SERVER_UNAVAILABLE)
View Source
var ERR_ID_IS_WRONG = InvalidRequest(
"ID length must be in range[1, 256]. Only [_a-zA-Z0-9]* symbols are allowed for id")
View Source
var ERR_INVALID_RECEIPT = InvalidRequest("Receipt is invalid")
View Source
var ERR_ITEM_ALREADY_EXISTS = ConflictRequest("Message exists already")
View Source
var ERR_MSG_ID_NOT_DEFINED = InvalidRequest("Message ID is not defined")
Parameter errors.
View Source
var ERR_MSG_IS_LOCKED = ConflictRequest("Message is locked")
View Source
var ERR_MSG_NOT_FOUND = NotFoundRequest("Message not found")
View Source
var ERR_MSG_NOT_LOCKED = InvalidRequest("Message is not locked")
View Source
var ERR_MSG_TIMEOUT_NOT_DEFINED = InvalidRequest("Message timeout is not defined")
View Source
var ERR_NO_RECEIPT = InvalidRequest("No receipt provided")
View Source
var ERR_NO_SVC = InvalidRequest("Service is not created")
View Source
var ERR_ONE_ID_ONLY = InvalidRequest("Only one ID at the time is currently supported")
View Source
var ERR_ONE_RECEIPT_ONLY = InvalidRequest("Only one receipt at the time is currently supported")
View Source
var ERR_RECEIPT_EXPIRED = InvalidRequest("Receipt has expired")
View Source
var ERR_SIZE_EXCEEDED = TemporaryError("Service capacity reached its limit")
View Source
var ERR_SVC_ALREADY_EXISTS = ConflictRequest("Service exists already")
View Source
var ERR_SVC_UNKNOWN_TYPE = InvalidRequest("Unknown service type")
View Source
var ERR_TOK_PARSING_ERROR = InvalidRequest("Error during token parsing")
View Source
var ERR_TOK_TOKEN_TOO_LONG = InvalidRequest("Token is too long")
View Source
var ERR_TOK_TOO_MANY_TOKENS = InvalidRequest("Too many tokens")
View Source
var ERR_TS_PARAMETER_NEEDED = InvalidRequest("TS parameters must be provided")
View Source
var ERR_USER_ID_IS_WRONG = InvalidRequest(
"ID length must be in range[1, 256]. Only ^[a-zA-Z0-9][_a-zA-Z0-9]* symbols are allowed for id")
View Source
var ERR_WRONG_SVC_NAME = InvalidRequest("Name can only include alphanumeric characters, hyphens, or underscores. 1 to 80 in length")
Functions ¶
This section is empty.
Types ¶
type ErrorResponse ¶
ErrorResponse is an error response.
func ConflictRequest ¶
func ConflictRequest(errorText string) *ErrorResponse
func InvalidRequest ¶
func InvalidRequest(errorText string) *ErrorResponse
func NewError ¶
func NewError(errorText string, errorCode int64) *ErrorResponse
func NotFoundRequest ¶
func NotFoundRequest(errorText string) *ErrorResponse
func ServerError ¶
func ServerError(errorText string) *ErrorResponse
func TemporaryError ¶
func TemporaryError(errorText string) *ErrorResponse
func UnknownParam ¶
func UnknownParam(paramName string) *ErrorResponse
func (*ErrorResponse) Error ¶
func (e *ErrorResponse) Error() string
func (*ErrorResponse) IsError ¶
func (e *ErrorResponse) IsError() bool
func (*ErrorResponse) StringResponse ¶
func (e *ErrorResponse) StringResponse() string
func (*ErrorResponse) WriteResponse ¶
func (e *ErrorResponse) WriteResponse(buf *bufio.Writer) error
Click to show internal directories.
Click to hide internal directories.