GetActionPath retrieves the custom action path for a script, if registered. Returns an empty string if the script doesn't have a custom action path.
(name string)
| 32 | // GetActionPath retrieves the custom action path for a script, if registered. |
| 33 | // Returns an empty string if the script doesn't have a custom action path. |
| 34 | func (r *ScriptRegistry) GetActionPath(name string) string { |
| 35 | r.mu.RLock() |
| 36 | defer r.mu.RUnlock() |
| 37 | |
| 38 | entry, exists := r.scripts[name] |
| 39 | if !exists { |
| 40 | if registryLog.Enabled() { |
| 41 | registryLog.Printf("GetActionPath: script not found: %s", name) |
| 42 | } |
| 43 | return "" |
| 44 | } |
| 45 | if registryLog.Enabled() && entry.actionPath != "" { |
| 46 | registryLog.Printf("GetActionPath: returning action path for %s: %s", name, entry.actionPath) |
| 47 | } |
| 48 | return entry.actionPath |
| 49 | } |
| 50 | |
| 51 | // DefaultScriptRegistry is the global script registry used by the workflow package. |
| 52 | // Scripts are registered during package initialization via init() functions. |
no test coverage detected