Debian Codegraph @

reverse.go

raw
1 package dns
2
3 import "codeberg.org/miekg/dns/internal/reverse"
4
5 // StringToType is the reverse of [TypeToString].
6 // Basic example how to convert between types and strings:
7 //
8 // tpy := dns.StringToType["mx"]
9 // str := dnsutil.TypeToString(tpy)
10 // fmt.Println(str) // "MX"
11 var StringToType = reverse.Map(TypeToString)
12
13 // StringToCode is the reverse of [CodeToString].
14 var StringToCode = reverse.Map(CodeToString)
15
16 // StringToClass is the reverse of [ClassToString].
17 var StringToClass = reverse.Map(ClassToString)
18
19 // StringToOpcode is a map of opcodes to strings.
20 var StringToOpcode = reverse.Map(OpcodeToString)
21
22 // StringToRcode is a map of rcodes to strings.
23 var StringToRcode = reverse.Map(RcodeToString)
24
25 // StringToAlgorithm is the reverse of [AlgorithmToString].
26 var StringToAlgorithm = reverse.Map(AlgorithmToString)
27
28 // StringToHash is a map of names to hash IDs.
29 var StringToHash = reverse.Map(HashToString)
30
31 // StringToCertType is the reverse of [CertTypeToString].
32 var StringToCertType = reverse.Map(CertTypeToString)