go-vitess.v1: gopkg.in/src-d/go-vitess.v1/vt/events Index | Files

package events

import "gopkg.in/src-d/go-vitess.v1/vt/events"

Package events defines common structures used for events dispatched from various other package.

Index

Package Files

status.go

type StatusUpdater Uses

type StatusUpdater struct {
    Status string

    // EventID is used to group the steps of a multi-part event.
    // It is set internally the first time Update() is called.
    EventID int64
}

StatusUpdater is a base struct for multi-part events with a status string that gets updated as the process progresses. StatusUpdater implements event.Updater, so if you embed a StatusUpdater into an event type, you can set a new status and dispatch that event in one call with DispatchUpdate.

For example:

type MyEvent struct {
  StatusUpdater
}
ev := &MyEvent{}
event.DispatchUpdate(ev, "new status")

func (*StatusUpdater) Update Uses

func (su *StatusUpdater) Update(status interface{})

Update sets a new status and initializes the EventID if necessary. This implements event.Updater.Update().

Package events imports 1 packages (graph) and is imported by 4 packages. Updated 2019-06-13. Refresh now. Tools for package owners.