Documentation
¶
Index ¶
- Variables
- func DecryptTxt(encText string, key []byte) (string, error)
- func EncryptTxt(text string, key []byte) (string, error)
- func QueryTxt(ctx context.Context, timeout time.Duration, domain string) ([]string, error)
- func QueryTxtByProvider(ctx context.Context, timeout time.Duration, domain string, ...) ([]string, error)
- type DoHProvider
Constants ¶
This section is empty.
Variables ¶
View Source
var ( AliDoH = DoHProvider{ Name: "aliyun", Endpoint: "https://dns.alidns.com/dns-query", } TencentDoH = DoHProvider{ Name: "tencent", Endpoint: "https://doh.pub/dns-query", } CloudflareDoH = DoHProvider{ Name: "cloudflare", Endpoint: "https://cloudflare-dns.com/dns-query", } )
Functions ¶
func DecryptTxt ¶ added in v1.0.1
DecryptTxt 将加密字符串解密为原始明文字符串。 输入格式必须是:base64(nonce + ciphertext)。 key 长度必须是 16、24、32 之一,且必须与加密时使用的 key 一致。
func EncryptTxt ¶ added in v1.0.1
EncryptTxt 将明文字符串加密为一个可传输的字符串。 输出格式为:base64(nonce + ciphertext)。 key 长度必须是 16、24、32 之一,分别对应 AES-128、AES-192、AES-256。
func QueryTxtByProvider ¶
Types ¶
type DoHProvider ¶
Click to show internal directories.
Click to hide internal directories.