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
|
2016-08-30 19:27:50 +08:00
|
|
|
// or Adaptor
|
2014-06-12 02:37:20 +08:00
|
|
|
type Event struct {
|
2016-08-30 19:27:50 +08:00
|
|
|
Name string
|
|
|
|
Data interface{}
|
2014-06-12 02:37:20 +08:00
|
|
|
}
|
|
|
|
|
2016-08-30 19:27:50 +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
|
|
|
}
|