Documentation ¶
Index ¶
- Constants
- Variables
- func GetError(code ErrorCode) error
- func GetErrorMessage(code ErrorCode) string
- func New(text string) *err
- type Err
- type ErrorCode
- type Http
- func (Http) BadGateway(w http.ResponseWriter)
- func (Http) BadParameter(w http.ResponseWriter, args ...string)
- func (Http) BadRequest(w http.ResponseWriter, msg ...string)
- func (Http) Forbidden(w http.ResponseWriter, msg ...string)
- func (Http) InternalServerError(w http.ResponseWriter, msg ...string)
- func (Http) InvalidJSON(w http.ResponseWriter, msg ...string)
- func (Http) InvalidXML(w http.ResponseWriter, msg ...string)
- func (Http) NotAllowed(w http.ResponseWriter, msg ...string)
- func (Http) NotFound(w http.ResponseWriter, args ...string)
- func (Http) NotImplemented(w http.ResponseWriter, msg ...string)
- func (h Http) ParseGrpcError(w http.ResponseWriter, err error)
- func (Http) PaymentRequired(w http.ResponseWriter, msg ...string)
- func (Http) Unauthorized(w http.ResponseWriter, msg ...string)
Constants ¶
View Source
const ( StatusNotFound = "Not Found" StatusBadParameter = "Bad Parameter" StatusInUse = "In use" StatusBadRequest = "Bad Request" StatusUnknown = "Unknown" StatusIncorrectXml = "Incorrect Xml" StatusIncorrectJson = "Incorrect Json" StatusNotUnique = "Not Unique" StatusInternalServerError = "Internal Server Error" StatusForbidden = "Forbidden" StatusNotAllowed = "Not Allowed" )
View Source
const ( ErrorInviteNotFound = iota ErrorUsernameInUse ErrorEmailInUse ErrorAccountNotFound ErrorNotUnique ErrorAlreadyAttached ErrorNoAttached ErrorUnknown )
Variables ¶
View Source
var GrpcErrorHandlerFunc = HTTP.ParseGrpcError
Functions ¶
func GetErrorMessage ¶
Types ¶
type Err ¶
func BadParameter ¶
func IncorrectJSON ¶
func IncorrectXML ¶
func NotAllowed ¶
func (*Err) Http ¶
func (e *Err) Http(w http.ResponseWriter)
func (*Err) SetMessage ¶
type Http ¶
type Http struct { Code int `json:"code"` Status string `json:"status"` Message string `json:"message"` }
var HTTP Http
func (Http) BadGateway ¶
func (Http) BadGateway(w http.ResponseWriter)
func (Http) BadParameter ¶
func (Http) BadParameter(w http.ResponseWriter, args ...string)
func (Http) BadRequest ¶
func (Http) BadRequest(w http.ResponseWriter, msg ...string)
func (Http) InternalServerError ¶
func (Http) InternalServerError(w http.ResponseWriter, msg ...string)
func (Http) InvalidJSON ¶
func (Http) InvalidJSON(w http.ResponseWriter, msg ...string)
func (Http) InvalidXML ¶
func (Http) InvalidXML(w http.ResponseWriter, msg ...string)
func (Http) NotAllowed ¶
func (Http) NotAllowed(w http.ResponseWriter, msg ...string)
func (Http) NotImplemented ¶
func (Http) NotImplemented(w http.ResponseWriter, msg ...string)
func (Http) ParseGrpcError ¶
func (h Http) ParseGrpcError(w http.ResponseWriter, err error)
func (Http) PaymentRequired ¶
func (Http) PaymentRequired(w http.ResponseWriter, msg ...string)
func (Http) Unauthorized ¶
func (Http) Unauthorized(w http.ResponseWriter, msg ...string)
Click to show internal directories.
Click to hide internal directories.