Documentation ¶
Index ¶
- func BoolLogic(ctx context.Context, qCtx *handler.Context, fs []handler.Matcher, ...) (matched bool, err error)
- func BytesToStringUnsafe(b []byte) string
- func GenerateCertificate(dnsName string) (cert tls.Certificate, err error)
- func GetIPFromAddr(addr net.Addr) (ip net.IP)
- func GetMsgKey(m *dns.Msg, salt uint16) (string, error)
- func GetMsgKeyWithBytesSalt(m *dns.Msg, salt []byte) (string, error)
- func GetMsgKeyWithInt64Salt(m *dns.Msg, salt int64) (string, error)
- func IsIPAddr(s string) bool
- func LoadCertPool(certs []string) (*x509.CertPool, error)
- func RemoveComment(s, symbol string) string
- func SplitLine(s string) []string
- func SplitLineReg(s string) []string
- func SplitSchemeAndHost(addr string) (protocol, host string)
- func SplitString2(s, symbol string) (s1 string, s2 string, ok bool)
- type NetAddr
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BytesToStringUnsafe ¶
BytesToStringUnsafe converts bytes to string.
func GenerateCertificate ¶
func GenerateCertificate(dnsName string) (cert tls.Certificate, err error)
GenerateCertificate generates a ecdsa certificate with given dnsName. This should only use in test.
func GetIPFromAddr ¶
GetIPFromAddr returns net.IP from net.Addr. Will return nil if no ip address can be parsed.
func GetMsgKeyWithBytesSalt ¶ added in v2.2.0
GetMsgKeyWithBytesSalt unpacks m and appends salt to the string.
func GetMsgKeyWithInt64Salt ¶ added in v2.2.0
GetMsgKeyWithInt64Salt unpacks m and appends salt to the string.
func LoadCertPool ¶
LoadCertPool reads and loads certificates in certs.
func RemoveComment ¶
RemoveComment removes comment after "symbol".
func SplitLineReg ¶
SplitLineReg extracts words from s by using regexp "\S+".
func SplitSchemeAndHost ¶
SplitSchemeAndHost splits addr to protocol and host.
Types ¶
type NetAddr ¶
type NetAddr struct {
// contains filtered or unexported fields
}
NetAddr implements net.Addr interface.
func NewNetAddr ¶
Click to show internal directories.
Click to hide internal directories.