MCPcopy
hub / github.com/caddyserver/caddy / GetModuleID

Function GetModuleID

modules.go:187–193  ·  modules.go::GetModuleID

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)

Source from the content-addressed store, hash-verified

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.
187func 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",

Callers

nothing calls this directly

Calls 1

CaddyModuleMethod · 0.65

Tested by

no test coverage detected