structs

package
v0.0.0-...-32c792f Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2021 License: MIT Imports: 1 Imported by: 14

Documentation

Index

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

type Action struct {
	Type    string
	Index   uint64
	Payload interface{}
}

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

func NewErrorResponse(msg interface{}, data ...interface{}) (Response, error)

NewErrorResponse will return a Response with error message attached

func NewNoopResponse

func NewNoopResponse() (Response, error)

func NewResponse

func NewResponse(kind string, payload interface{}) Response

NewResponse will create a new Response instance

func NewResponseWithIndex

func NewResponseWithIndex(kind string, payload interface{}, index uint64) (Response, error)

NewResponseWithIndex will create a new response with an action with Index value

func NewSuccessResponse

func NewSuccessResponse(msg string, data ...interface{}) (Response, error)

NewSuccessResponse will return a new Response with a Success message attached and no error

func (*Response) Actions

func (r *Response) Actions() []*Action

Actions will return all actions buffered in the response

func (*Response) Add

func (r *Response) Add(action *Action)

Add will append a new action to the response

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

type Responser

type Responser interface {
	Actions() []*Action
}

Responser interface

Jump to

Keyboard shortcuts

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