MCPcopy Index your code
hub / github.com/foxcpp/maddy / StringList

Method StringList

framework/config/map.go:357–370  ·  view source on GitHub ↗

StringList maps configuration directive with the specified name to variable referenced by 'store' pointer. Configuration directive must be in form 'name arbitrary_string arbitrary_string ...' Where at least one argument must be present. See Custom function for details about inheritGlobal, required

(name string, inheritGlobal, required bool, defaultVal []string, store *[]string)

Source from the content-addressed store, hash-verified

355// See Custom function for details about inheritGlobal, required and
356// defaultVal.
357func (m *Map) StringList(name string, inheritGlobal, required bool, defaultVal []string, store *[]string) {
358 m.Custom(name, inheritGlobal, required, func() (interface{}, error) {
359 return defaultVal, nil
360 }, func(_ *Map, node Node) (interface{}, error) {
361 if len(node.Args) == 0 {
362 return nil, NodeErr(node, "expected at least one argument")
363 }
364 if len(node.Children) != 0 {
365 return nil, NodeErr(node, "can't declare block here")
366 }
367
368 return node.Args, nil
369 }, store)
370}
371
372// String maps configuration directive with the specified name to variable
373// referenced by 'store' pointer.

Callers 13

ReadGlobalsFunction · 0.95
TLSClientBlockFunction · 0.95
ProxyProtocolDirectiveFunction · 0.95
readListCfgMethod · 0.95
ConfigureMethod · 0.80
ConfigureMethod · 0.80
ConfigureMethod · 0.80
ConfigureMethod · 0.80
ConfigureMethod · 0.80
ConfigureMethod · 0.80
ConfigureMethod · 0.80
ConfigureMethod · 0.80

Calls 2

CustomMethod · 0.95
NodeErrFunction · 0.70

Tested by

no test coverage detected