MCPcopy
hub / github.com/TecharoHQ/anubis / String

Method String

lib/config/expressionorlist.go:23–47  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

21}
22
23func (eol ExpressionOrList) String() string {
24 switch {
25 case len(eol.Expression) != 0:
26 return eol.Expression
27 case len(eol.All) != 0:
28 var sb strings.Builder
29 for i, pred := range eol.All {
30 if i != 0 {
31 fmt.Fprintf(&sb, " && ")
32 }
33 fmt.Fprintf(&sb, "( %s )", pred)
34 }
35 return sb.String()
36 case len(eol.Any) != 0:
37 var sb strings.Builder
38 for i, pred := range eol.Any {
39 if i != 0 {
40 fmt.Fprintf(&sb, " || ")
41 }
42 fmt.Fprintf(&sb, "( %s )", pred)
43 }
44 return sb.String()
45 }
46 panic("this should not happen")
47}
48
49func (eol ExpressionOrList) Equal(rhs *ExpressionOrList) bool {
50 if eol.Expression != rhs.Expression {

Callers 15

FetchBlocklistFunction · 0.45
main.goFile · 0.45
makeCodeFunction · 0.45
TestBasePrefixFunction · 0.45
issueChallengeMethod · 0.45
maybeReverseProxyMethod · 0.45
handleDNSBLMethod · 0.45
checkMethod · 0.45
TestRedirectSecurityFunction · 0.45

Calls

no outgoing calls

Tested by 9

TestBasePrefixFunction · 0.36
TestRedirectSecurityFunction · 0.36
TestURLValuesFunction · 0.36
TestHTTPHeadersFunction · 0.36
TestBotEnvironmentFunction · 0.36
TestBasePrefixInLinksFunction · 0.36