Skip to content

Commit

Permalink
Expose an api get all registered activity (#217)
Browse files Browse the repository at this point in the history
* expose all api to get all registered activity

* return copy of map

* return copy map with name registeredActivities
  • Loading branch information
lixingwang authored Jul 29, 2020
1 parent d60e4e8 commit 9e69d50
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions activity/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ func Register(activity Activity, f ...Factory) error {
return nil
}

func Activities() map[string]Activity {
registeredActivities := make(map[string]Activity)
for k, v := range activities {
registeredActivities[k] = v
}
return registeredActivities
}

func GetRef(activity Activity) string {
return support.GetRef(activity)
}
Expand Down

0 comments on commit 9e69d50

Please sign in to comment.