Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions go/internal/registry/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,17 +207,50 @@ func (r *Registry) ListActions() []api.Action {
r.mu.RLock()
defer r.mu.RUnlock()
var actions []api.Action
if r.parent != nil {
parentValues := r.parent.ListActions()
for _, pv := range parentValues {
found := false
for _, cv := range r.actions {
if pv.Name() == cv.Name() {
found = true
break
}
}
if !found {
actions = append(actions, pv)
}
}
}
for _, v := range r.actions {
actions = append(actions, v)
}
return actions
}

// ListPlugins returns a list of all registered plugins.
// This includes plugins from both the current registry and its parent hierarchy.
// Child registry plugins take precedence over parent plugins with the same key.
func (r *Registry) ListPlugins() []api.Plugin {
r.mu.RLock()
defer r.mu.RUnlock()
var plugins []api.Plugin
if r.parent != nil {
parentValues := r.parent.ListPlugins()
for _, pv := range parentValues {
found := false
for _, cv := range r.plugins {
if pv.Name() == cv.Name() {
found = true
break
}
}
if !found {
plugins = append(plugins, pv)
}
}
}

for _, p := range r.plugins {
plugins = append(plugins, p)
}
Expand Down
Loading