hybridgroup.gobot/event.go

14 lines
303 B
Go
Raw Normal View History

2014-06-12 02:37:20 +08:00
package gobot
2017-09-23 16:46:19 +08:00
// Event represents when something asynchronous happens in a Driver
// or Adaptor
2014-06-12 02:37:20 +08:00
type Event struct {
Name string
Data interface{}
2014-06-12 02:37:20 +08:00
}
// NewEvent returns a new Event and its associated data.
func NewEvent(name string, data interface{}) *Event {
return &Event{Name: name, Data: data}
2014-06-12 02:37:20 +08:00
}