Documentation ¶
Index ¶
- Constants
- type Action
- type Response
- func NewErrorResponse(msg interface{}, data ...interface{}) (Response, error)
- func NewNoopResponse() (Response, error)
- func NewResponse(kind string, payload interface{}) Response
- func NewResponseWithIndex(kind string, payload interface{}, index uint64) (Response, error)
- func NewSuccessResponse(msg string, data ...interface{}) (Response, error)
- type Responser
Constants ¶
View Source
const ( KeepAlive = "INTERNAL_KEEP_ALIVE" ErrorNotification = "APP_ERROR_NOTIFICATION" SuccessNotification = "APP_SUCCESS_NOTIFICATION" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Action ¶
Action represents a Redux action that is dispatched or received from the store via a websocket connection.
type Response ¶
type Response struct {
// contains filtered or unexported fields
}
Response implementation
func NewErrorResponse ¶
NewErrorResponse will return a Response with error message attached
func NewNoopResponse ¶
func NewResponse ¶
NewResponse will create a new Response instance
func NewResponseWithIndex ¶
NewResponseWithIndex will create a new response with an action with Index value
func NewSuccessResponse ¶
NewSuccessResponse will return a new Response with a Success message attached and no error
func (*Response) AddError ¶
func (r *Response) AddError(payload interface{})
AddError will append a new error action to the response
func (*Response) AddSuccess ¶
func (r *Response) AddSuccess(payload interface{})
AddSuccess will append a new success action to the response
Click to show internal directories.
Click to hide internal directories.