Documentation ¶
Index ¶
- func NewPayload(data interface{}) *payload
- type Hub
- func (h *Hub) Batch(f func(), shouldLock bool)
- func (h *Hub) DrawCh() chan Payload
- func (h *Hub) PagingCh() chan Payload
- func (h *Hub) QueryCh() chan Payload
- func (h *Hub) SendDraw(options interface{})
- func (h *Hub) SendDrawPrompt()
- func (h *Hub) SendPaging(x interface{})
- func (h *Hub) SendPurgeDisplayCache()
- func (h *Hub) SendQuery(q string)
- func (h *Hub) SendStatusMsg(q string)
- func (h *Hub) SendStatusMsgAndClear(q string, clearDelay time.Duration)
- func (h *Hub) StatusMsgCh() chan Payload
- type Payload
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewPayload ¶
func NewPayload(data interface{}) *payload
Types ¶
type Hub ¶
type Hub struct {
// contains filtered or unexported fields
}
Hub acts as the messaging hub between components -- that is, it controls how the communication that goes through channels are handled.
func (*Hub) Batch ¶
Batch allows you to synchronously send messages during the scope of f() being executed.
func (*Hub) SendDraw ¶
func (h *Hub) SendDraw(options interface{})
SendDraw sends a request to redraw the terminal display
func (*Hub) SendDrawPrompt ¶
func (h *Hub) SendDrawPrompt()
SendDrawPrompt sends a request to redraw the prompt only
func (*Hub) SendPaging ¶
func (h *Hub) SendPaging(x interface{})
SendPaging sends a request to move the cursor around
func (*Hub) SendPurgeDisplayCache ¶
func (h *Hub) SendPurgeDisplayCache()
func (*Hub) SendStatusMsg ¶
SendStatusMsg sends a string to be displayed in the status message
func (*Hub) SendStatusMsgAndClear ¶
SendStatusMsgAndClear sends a string to be displayed in the status message, as well as a delay until the message should be cleared
func (*Hub) StatusMsgCh ¶
StatusMsgCh returns the channel to update the status message
type Payload ¶
type Payload interface { // Data allows you to retrieve the data that's embedded in the payload. Data() interface{} // Done is called when the payload has been processed. There are cases // where the payload processing is expected to be synchronized with the // caller, and this method signals the caller that it is safe to proceed // to whatever next action it was expecting Done() }
Payload is a wrapper around the actual request value that needs to be passed. It contains an optional channel field which can be filled to force synchronous communication between the sender and receiver