New Admin Info (#8497)

This commit is contained in:
Ashish Kumar Sinha
2019-12-12 03:57:03 +05:30
committed by kannappanr
parent 8b803491af
commit 24fb1bf258
22 changed files with 766 additions and 275 deletions

View File

@@ -24,6 +24,7 @@ import (
// Target - event target interface
type Target interface {
ID() TargetID
IsActive() (bool, error)
Save(Event) error
Send(string) error
Close() error
@@ -130,6 +131,13 @@ func (list *TargetList) List() []TargetID {
return keys
}
// TargetMap - returns available targets.
func (list *TargetList) TargetMap() map[TargetID]Target {
list.RLock()
defer list.RUnlock()
return list.targets
}
// Send - sends events to targets identified by target IDs.
func (list *TargetList) Send(event Event, targetIDs ...TargetID) <-chan TargetIDErr {
errCh := make(chan TargetIDErr)