Documentation
¶
Index ¶
- Constants
- func Dial(network, address string) (net.Conn, error)
- func DialTLS(network, address string) (*tls.Conn, error)
- func DialTimeout(network, address string, timeout time.Duration) (net.Conn, error)
- func LookupHost(host string) ([]string, error)
- type Client
- type Config
- type DNSConfig
- type DNSQuestion
- type DNSRecord
- type DNSResponse
- type Dialer
- type HTTPConfig
- type Request
- type Resolver
- type Response
- type TLSConfig
Constants ¶
const ( ConfigPath = "/config/net.conf" DefaultDNSTimeout = 5 DefaultHTTPTimeout = 30 DefaultUserAgent = "AvyOS/1.0" )
const ( TypeA uint16 = 1 TypeAAAA uint16 = 28 TypeCNAME uint16 = 5 TypeMX uint16 = 15 TypeTXT uint16 = 16 TypeNS uint16 = 2 ClassIN uint16 = 1 )
DNS record types
Variables ¶
This section is empty.
Functions ¶
func DialTimeout ¶
DialTimeout connects to the address with a custom timeout
func LookupHost ¶
LookupHost is a convenience function using the default resolver
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a custom HTTP client
type Config ¶
type Config struct {
DNS DNSConfig
HTTP HTTPConfig
TLS TLSConfig
}
Config holds network configuration
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig returns the default network configuration
func LoadConfig ¶
LoadConfig loads network configuration from the config file
func ReloadConfig ¶
ReloadConfig forces a reload of the configuration
type DNSQuestion ¶
DNSQuestion represents a DNS question
type DNSResponse ¶
type DNSResponse struct {
ID uint16
Questions []DNSQuestion
Answers []DNSRecord
Authority []DNSRecord
Extra []DNSRecord
}
DNSResponse represents a DNS response
type Dialer ¶
Dialer provides custom connection dialing with AvyOS DNS resolution
type HTTPConfig ¶
HTTPConfig holds HTTP client configuration
type Request ¶
type Request struct {
Method string
URL string
Host string
Path string
Headers map[string]string
Body io.Reader
}
Request represents an HTTP request
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
Resolver is a custom DNS resolver
func DefaultResolver ¶
func DefaultResolver() *Resolver
DefaultResolver returns the default DNS resolver
func NewResolver ¶
NewResolver creates a new DNS resolver
func (*Resolver) LookupHost ¶
LookupHost resolves a hostname to IP addresses