initial commit

This commit is contained in:
ginuerzh
2022-03-16 19:40:29 +08:00
commit 7db81fcfeb
109 changed files with 8782 additions and 0 deletions

17
resolver/resolver.go Normal file
View File

@ -0,0 +1,17 @@
package resolver
import (
"context"
"errors"
"net"
)
var (
ErrInvalid = errors.New("resolver is invalid")
)
type Resolver interface {
// Resolve returns a slice of the host's IPv4 and IPv6 addresses.
// The network should be 'ip', 'ip4' or 'ip6', default network is 'ip'.
Resolve(ctx context.Context, network, host string) ([]net.IP, error)
}