sutils

package
v2.4.3+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2016 License: BSD-3-Clause, GPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	UPDATE_INTERVAL    uint32 = 10
	ErrUpdaterNotFound        = errors.New("updater not found")
)
View Source
var (
	BufferPool = sync.Pool{
		New: func() interface{} {
			return make([]byte, 8192)
		},
	}
)
View Source
var DefaultTcpDialer = &TcpDialer{}

Functions

func CopyLink(dst, src io.ReadWriteCloser)

func UpdateAdd

func UpdateAdd(u Updater)

func UpdateRemove

func UpdateRemove(u Updater) (err error)

Types

type Dialer

type Dialer interface {
	Dial(string, string) (net.Conn, error)
}

type DnsLookup

type DnsLookup struct {
	Servers []string
	// contains filtered or unexported fields
}

func NewDnsLookup

func NewDnsLookup(Servers []string, dnsnet string) (d *DnsLookup)

func (*DnsLookup) Exchange

func (d *DnsLookup) Exchange(m *dns.Msg) (r *dns.Msg, err error)

func (*DnsLookup) LookupIP

func (d *DnsLookup) LookupIP(host string) (addrs []net.IP, err error)

type Lookuper

type Lookuper interface {
	LookupIP(host string) (addrs []net.IP, err error)
}
var DefaultLookuper Lookuper

type NetLookupIP

type NetLookupIP struct {
}

func (*NetLookupIP) LookupIP

func (n *NetLookupIP) LookupIP(host string) (addrs []net.IP, err error)

type TcpDialer

type TcpDialer struct {
}

func (*TcpDialer) Dial

func (td *TcpDialer) Dial(network, address string) (net.Conn, error)

func (*TcpDialer) DialTimeout

func (td *TcpDialer) DialTimeout(network, address string, timeout time.Duration) (net.Conn, error)

type Updater

type Updater interface {
	Update()
}

Jump to

Keyboard shortcuts

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