Source File
reverse.go
Belonging Package
github.com/miekg/dns
package dns// StringToType is the reverse of TypeToString, needed for string parsing.var StringToType = reverseInt16(TypeToString)// StringToClass is the reverse of ClassToString, needed for string parsing.var StringToClass = reverseInt16(ClassToString)// StringToOpcode is a map of opcodes to strings.var StringToOpcode = reverseInt(OpcodeToString)// StringToRcode is a map of rcodes to strings.var StringToRcode = reverseInt(RcodeToString)func init() {// Preserve previous NOTIMP typo, see github.com/miekg/dns/issues/733.StringToRcode["NOTIMPL"] = RcodeNotImplemented}// StringToAlgorithm is the reverse of AlgorithmToString.var StringToAlgorithm = reverseInt8(AlgorithmToString)// StringToHash is a map of names to hash IDs.var StringToHash = reverseInt8(HashToString)// StringToCertType is the reverse of CertTypeToString.var StringToCertType = reverseInt16(CertTypeToString)// StringToStatefulType is the reverse of StatefulTypeToString.var StringToStatefulType = reverseInt16(StatefulTypeToString)// Reverse a mapfunc reverseInt8( map[uint8]string) map[string]uint8 {:= make(map[string]uint8, len())for , := range {[] =}return}func reverseInt16( map[uint16]string) map[string]uint16 {:= make(map[string]uint16, len())for , := range {[] =}return}func reverseInt( map[int]string) map[string]int {:= make(map[string]int, len())for , := range {[] =}return}
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |