myDOH

package module
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 21, 2026 License: BSD-2-Clause Imports: 13 Imported by: 0

README

myDOH

DNS OVER HTTP QUERY PACKAGE

Documentation

Index

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

func DecryptTxt(encText string, key []byte) (string, error)

DecryptTxt 将加密字符串解密为原始明文字符串。 输入格式必须是:base64(nonce + ciphertext)。 key 长度必须是 16、24、32 之一,且必须与加密时使用的 key 一致。

func EncryptTxt added in v1.0.1

func EncryptTxt(text string, key []byte) (string, error)

EncryptTxt 将明文字符串加密为一个可传输的字符串。 输出格式为:base64(nonce + ciphertext)。 key 长度必须是 16、24、32 之一,分别对应 AES-128、AES-192、AES-256。

func QueryTxt

func QueryTxt(ctx context.Context, timeout time.Duration, domain string) ([]string, error)

func QueryTxtByProvider

func QueryTxtByProvider(ctx context.Context, timeout time.Duration, domain string, provider DoHProvider) ([]string, error)

Types

type DoHProvider

type DoHProvider struct {
	Name     string
	Endpoint string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL