Browse Source

add Event.TargetIDs method.

master
Gisle Aune 4 years ago
parent
commit
c897421f20
  1. 9
      event.go

9
event.go

@ -175,6 +175,15 @@ func (event *Event) StatusTarget() *Status {
return target.(*Status)
}
func (event *Event) TargetIDs() []string {
ids := make([]string, len(event.targets))
for _, value := range event.targetIds {
ids = append(ids, value)
}
return ids
}
// MarshalJSON makes a JSON object from the event.
func (event *Event) MarshalJSON() ([]byte, error) {
data := eventJSONData{

Loading…
Cancel
Save