Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HostNetwork ¶
type HostNetwork struct{}
func Host ¶
func Host() *HostNetwork
Host returns a network implementation that uses the host's network stack.
func (*HostNetwork) DialContext ¶
func (*HostNetwork) LookupContextHost ¶
type LoopbackNetwork ¶
type LoopbackNetwork struct{}
func Loopback ¶
func Loopback() *LoopbackNetwork
Loopback returns a network that only connects to localhost.
func (*LoopbackNetwork) DialContext ¶
func (*LoopbackNetwork) LookupContextHost ¶
type Network ¶
type Network interface {
// DialContext connects to the address on the named network using the provided context.
DialContext(ctx context.Context, network, addr string) (net.Conn, error)
// LookupContextHost looks up the given host using the local resolver.
// It returns a slice of that host's addresses.
LookupContextHost(ctx context.Context, host string) ([]string, error)
}
Network is a simple network abstraction.
Click to show internal directories.
Click to hide internal directories.