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

Function GetModuleName

modules.go:177–183  ·  modules.go::GetModuleName

GetModuleName returns a module's name (the last label of its 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

175// from an instance of its value. If the value is not a module, an
176// empty string will be returned.
177func GetModuleName(instance any) string {
178 var name string
179 if mod, ok := instance.(Module); ok {
180 name = mod.CaddyModule().ID.Name()
181 }
182 return name
183}
184
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.

Callers

nothing calls this directly

Calls 2

CaddyModuleMethod · 0.65
NameMethod · 0.45

Tested by

no test coverage detected