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

Method String

framework/config/map.go:379–392  ·  view source on GitHub ↗

String maps configuration directive with the specified name to variable referenced by 'store' pointer. Configuration directive must be in form 'name arbitrary_string'. See Custom function for details about inheritGlobal, required and defaultVal.

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

Source from the content-addressed store, hash-verified

377// See Custom function for details about inheritGlobal, required and
378// defaultVal.
379func (m *Map) String(name string, inheritGlobal, required bool, defaultVal string, store *string) {
380 m.Custom(name, inheritGlobal, required, func() (interface{}, error) {
381 return defaultVal, nil
382 }, func(_ *Map, node Node) (interface{}, error) {
383 if len(node.Args) != 1 {
384 return nil, NodeErr(node, "expected 1 argument")
385 }
386 if len(node.Children) != 0 {
387 return nil, NodeErr(node, "can't declare block here")
388 }
389
390 return node.Args[0], nil
391 }, store)
392}
393
394// Int maps configuration directive with the specified name to variable
395// referenced by 'store' pointer.

Callers 15

ReadGlobalsFunction · 0.95
TLSClientBlockFunction · 0.95
parseResponseRuleFunction · 0.95
initDebugFunction · 0.45
handleSignalsFunction · 0.45
formatMsgMethod · 0.45
marshalOrderedJSONFunction · 0.45
WriteMethod · 0.45
TestStandardizeAddressFunction · 0.45
ToUnicodeFunction · 0.45
UnquoteMboxFunction · 0.45
QuoteMboxFunction · 0.45

Calls 2

CustomMethod · 0.95
NodeErrFunction · 0.70

Tested by 10

TestStandardizeAddressFunction · 0.36
TestImapsqlDeliveryFunction · 0.36
isDovecot24Function · 0.36
TestImapStorageSwitchFunction · 0.36
runChasquidFunction · 0.36