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

Function isModuleMapType

modules.go:365–369  ·  view source on GitHub ↗

isModuleMapType returns true if the type is map[string]json.RawMessage. It assumes that the string key is the module name, but this is not always the case. To know for sure, this function must return true, but also the struct tag where this type appears must NOT define an inline_key attribute, which

(typ reflect.Type)

Source from the content-addressed store, hash-verified

363// attribute, which would mean that the module names appear inline with the
364// values, not in the key.
365func isModuleMapType(typ reflect.Type) bool {
366 return typ.Kind() == reflect.Map &&
367 typ.Key().Kind() == reflect.String &&
368 isJSONRawMessage(typ.Elem())
369}
370
371// ProxyFuncProducer is implemented by modules which produce a
372// function that returns a URL to use as network proxy. Modules

Callers 2

LoadModuleMethod · 0.85

Calls 1

isJSONRawMessageFunction · 0.85

Tested by

no test coverage detected