GetModuleID returns a module's ID from an instance of its value. If the value is not a module, an empty string will be returned.
(instance any)
| 185 | // GetModuleID returns a module's ID from an instance of its value. |
| 186 | // If the value is not a module, an empty string will be returned. |
| 187 | func GetModuleID(instance any) string { |
| 188 | var id string |
| 189 | if mod, ok := instance.(Module); ok { |
| 190 | id = string(mod.CaddyModule().ID) |
| 191 | } |
| 192 | return id |
| 193 | } |
| 194 | |
| 195 | // GetModules returns all modules in the given scope/namespace. |
| 196 | // For example, a scope of "foo" returns modules named "foo.bar", |
nothing calls this directly
no test coverage detected