common

package
v1.2.17 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2022 License: LGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MinDNSPacketSize        = 12 + 5
	MaxDNSPacketSize        = dns.MaxMsgSize
	MaxDNSUDPPacketSize     = dns.DefaultMsgSize
	MaxDNSUDPSafePacketSize = 1252
	STAR                    = "*"
	Delimiter               = ";"
)
View Source
const Program_dbg_full = false

only if deep debug e.g. raw msg dumping

Variables

View Source
var AppVersion = "dev-X"
View Source
var ErrInferfaceIsDown error = errors.New("specified inferface is down")
View Source
var ErrUnknownOptType error = errors.New("unsupported opts for Dial")

Functions

func Dial

func Dial(network, address string, ifi *string, timeout time.Duration, keepAlive time.Duration, opts ...interface{}) (net.Conn, error)

func ExtractHostAndPort

func ExtractHostAndPort(hostport string, defaultPort int) (string, int, error)

func GetDialer

func GetDialer(network string, ifi *string, timeout time.Duration, keepAlive time.Duration) (*net.Dialer, error)

func GetInferfaceDefaultAddr

func GetInferfaceDefaultAddr(name, network string) (ip net.Addr, err error)

func Max

func Max(a, b int) int

func Min

func Min(a, b int) int

func Min64

func Min64(x, y int64) int64

func ParallelDialWithDialer

func ParallelDialWithDialer(ctx context.Context, dialer Dialer, network, addr string, races int) (net.Conn, error)

memory grows; await on goose's fixing

func ParseIPZone

func ParseIPZone(s string) (net.IP, string)

func Program_dbg_full_log

func Program_dbg_full_log(args ...interface{})

func ReadDP

func ReadDP(conn net.Conn) ([]byte, error)

for DNS Packet

func StringQuote

func StringQuote(str *string) string

func WriteDP

func WriteDP(conn net.Conn, p []byte, clients ...*net.Addr) error

for DNS Packet

Types

type DialFn

type DialFn func(network, address string) (net.Conn, error)

type Dialer

type Dialer interface {
	DialContext(ctx context.Context, network, address string) (net.Conn, error)
}

type EPRing

type EPRing struct {
	*ring.Ring
	*Endpoint
	// contains filtered or unexported fields
}

func LinkEPRing

func LinkEPRing(endpoints ...*Endpoint) *EPRing

func (*EPRing) Next

func (e *EPRing) Next() *EPRing

func (*EPRing) Order

func (e *EPRing) Order() string

type Endpoint

type Endpoint struct {
	*net.IPAddr
	Port int
}

func ResolveEndpoint

func ResolveEndpoint(hostport string) (*Endpoint, error)

func (*Endpoint) String

func (e *Endpoint) String() string

type HTTPSContext added in v1.1.10

type HTTPSContext struct {
	*TLSContext
	Tag *string //redundant key; for cm.key() & connectMethodKey mod
}

soul of HTTPS

func (*HTTPSContext) Value added in v1.1.10

func (c *HTTPSContext) Value(key interface{}) interface{}

func (*HTTPSContext) WithContext added in v1.1.10

func (c *HTTPSContext) WithContext(inner context.Context) context.Context

type RegisteredServer

type RegisteredServer struct {
	Name  string
	Stamp *stamps.ServerStamp
}

type TLSContext

type TLSContext struct {
	context.Context
	TLSContextDial
}

func (*TLSContext) Value added in v1.1.10

func (c *TLSContext) Value(key interface{}) interface{}

type TLSContextDial added in v1.1.10

type TLSContextDial func(ctx context.Context, network, addr string) (*string, net.Conn, error)

name, conn, err

Jump to

Keyboard shortcuts

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