Documentation ¶
Index ¶
- func Publish(topic string, event interface{})
- func SubscribeToStatusEvents() chan interface{}
- func SubscribeToTopic(topic string) chan interface{}
- func Unsubscribe(ch chan interface{})
- type StatusEvent
- func SendFailureStatusFromError(reason string, err error) *StatusEvent
- func SendStatusEvent(s *StatusEvent) (*StatusEvent, func())
- func WaitForCompletedStatusEvent(t *testing.T, statusEvents chan interface{}, waitForSec int) *StatusEvent
- func WaitForFailureStatusEvent(t *testing.T, statusEvents chan interface{}, waitForSec int) *StatusEvent
- func WaitForStatusEvent(t *testing.T, statusEvents chan interface{}, waitForSec int, expectError bool) *StatusEvent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Publish ¶ added in v1.1.307
func Publish(topic string, event interface{})
Publish publishes any event
func SubscribeToStatusEvents ¶
func SubscribeToStatusEvents() chan interface{}
SubscribeToStatusEvents creates a channel which will receive new `StatusEvent` types
func SubscribeToTopic ¶ added in v1.1.307
func SubscribeToTopic(topic string) chan interface{}
SubscribeToTopic creates a channel which will receive event in that topic WARNING: Subscribers MUST process events QUICKLY when received or the event sender will BLOCK this results in the UI locking up.
Types ¶
type StatusEvent ¶
type StatusEvent struct { Message string Timeout time.Duration InProgress bool IsToast bool Failure bool // contains filtered or unexported fields }
StatusEvent is used to show status information in the statusbar
func SendFailureStatusFromError ¶ added in v1.2.787
func SendFailureStatusFromError(reason string, err error) *StatusEvent
SendFailureStatusFromError sends a status event representing the error mesage and reason
func SendStatusEvent ¶
func SendStatusEvent(s *StatusEvent) (*StatusEvent, func())
SendStatusEvent sends status events
func WaitForCompletedStatusEvent ¶ added in v1.1.394
func WaitForCompletedStatusEvent(t *testing.T, statusEvents chan interface{}, waitForSec int) *StatusEvent
WaitForCompletedStatusEvent waits for a completed event
func WaitForFailureStatusEvent ¶ added in v1.1.394
func WaitForFailureStatusEvent(t *testing.T, statusEvents chan interface{}, waitForSec int) *StatusEvent
WaitForFailureStatusEvent waits for failure event
func WaitForStatusEvent ¶ added in v1.1.394
func WaitForStatusEvent(t *testing.T, statusEvents chan interface{}, waitForSec int, expectError bool) *StatusEvent
WaitForStatusEvent lets you wait on a event
func (*StatusEvent) CreatedAt ¶
func (s *StatusEvent) CreatedAt() time.Time
CreatedAt returns the time of the message creation
func (*StatusEvent) Done ¶ added in v1.2.771
func (s *StatusEvent) Done()
Done marks the status event as done
func (*StatusEvent) HasExpired ¶
func (s *StatusEvent) HasExpired() bool
HasExpired returns true if the message has expired
func (*StatusEvent) Icon ¶ added in v1.2.771
func (s *StatusEvent) Icon() string
Icon returns an icon representing the event
func (*StatusEvent) SetTimeout ¶ added in v1.2.771
func (s *StatusEvent) SetTimeout(t time.Duration)
SetTimeout sets the timeout for a message, starting from now
func (*StatusEvent) Update ¶
func (s *StatusEvent) Update()
Update sends and update to the status event