Documentation ¶
Index ¶
- Constants
- func BadRequest(w http.ResponseWriter, message string, loggers chaoslogger.Loggers)
- func InternalServerError(w http.ResponseWriter, message string, loggers chaoslogger.Loggers)
- func OkResponse(w http.ResponseWriter, message string, loggers chaoslogger.Loggers)
- func RecoverResponse(w http.ResponseWriter, messages []*RecoverMessage, loggers chaoslogger.Loggers)
- type Payload
- type RecoverMessage
- type RecoverResponsePayload
Constants ¶
View Source
const ( SUCCESS status = iota FAILURE )
Variables ¶
This section is empty.
Functions ¶
func BadRequest ¶ added in v0.0.2
func BadRequest(w http.ResponseWriter, message string, loggers chaoslogger.Loggers)
func InternalServerError ¶ added in v0.0.2
func InternalServerError(w http.ResponseWriter, message string, loggers chaoslogger.Loggers)
func OkResponse ¶ added in v0.0.2
func OkResponse(w http.ResponseWriter, message string, loggers chaoslogger.Loggers)
func RecoverResponse ¶ added in v0.0.2
func RecoverResponse(w http.ResponseWriter, messages []*RecoverMessage, loggers chaoslogger.Loggers)
Types ¶
type Payload ¶
func (*Payload) SetInWriter ¶
func (p *Payload) SetInWriter(w http.ResponseWriter, loggers chaoslogger.Loggers)
type RecoverMessage ¶
type RecoverMessage struct { Message string `json:"message"` Error string `json:"error"` Status string `json:"status"` }
func FailureRecoverResponse ¶
func FailureRecoverResponse(message string) *RecoverMessage
func SuccessRecoverResponse ¶
func SuccessRecoverResponse(message string) *RecoverMessage
type RecoverResponsePayload ¶
type RecoverResponsePayload struct { RecoverMessage []*RecoverMessage `json:"recoverMessages"` Status int `json:"status"` }
func (*RecoverResponsePayload) BadRequest ¶
func (recoverR *RecoverResponsePayload) BadRequest(message string, logger log.Logger)
func (*RecoverResponsePayload) SetInWriter ¶
func (recoverR *RecoverResponsePayload) SetInWriter(w http.ResponseWriter, loggers chaoslogger.Loggers)
Click to show internal directories.
Click to hide internal directories.