-
Notifications
You must be signed in to change notification settings - Fork 0
/
stringers.go
76 lines (66 loc) · 1.4 KB
/
stringers.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
package rrl
import (
"fmt"
)
func (ac AllowanceCategory) String() string {
switch ac {
case AllowanceAnswer:
return "AllowanceAnswer"
case AllowanceReferral:
return "AllowanceReferral"
case AllowanceNoData:
return "AllowanceNoData"
case AllowanceNXDomain:
return "AllowanceNXDomain"
case AllowanceError:
return "AllowanceError"
}
return fmt.Sprintf("Unstringable AllowanceCategory %d", ac)
}
func (act Action) String() string {
switch act {
case Send:
return "Send"
case Drop:
return "Drop"
case Slip:
return "Slip"
}
return fmt.Sprintf("UnStringable Action %d", act)
}
func (ipr IPReason) String() string {
switch ipr {
case IPOk:
return "IPOk"
case IPNotConfigured:
return "IPNotConfigured"
case IPNotReached:
return "IPNotReached"
case IPRateLimit:
return "IPRateLimit"
case IPCacheFull:
return "IPCacheFull"
}
return fmt.Sprintf("UnStringable IPReason %d", ipr)
}
func (rtr RTReason) String() string {
switch rtr {
case RTOk:
return "RTOk"
case RTNotConfigured:
return "RTNotConfigured"
case RTRateLimit:
return "RTRateLimit"
case RTNotReached:
return "RTNotReached"
case RTNotUDP:
return "RTNotUDP"
case RTCacheFull:
return "RTCacheFull"
}
return fmt.Sprintf("UnStringable RTReason %d", rtr)
}
func (rt *ResponseTuple) String() string {
return fmt.Sprintf("%d/%d %s sn=%s",
rt.Class, rt.Type, rt.AllowanceCategory.String(), rt.SalientName)
}