2014-06-12 02:37:20 +08:00
|
|
|
package gobot
|
|
|
|
|
2016-08-30 19:27:50 +08:00
|
|
|
// Event represents when something asyncronous happens in a Driver
|
|
|
|
// 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
|
|
|
}
|