internal

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CeilToPowerOfTwo

func CeilToPowerOfTwo(n int) int

CeilToPowerOfTwo returns the least power of two integer value greater than or equal to n.

func FloorToPowerOfTwo

func FloorToPowerOfTwo(n int) int

FloorToPowerOfTwo returns the greatest power of two integer value less than or equal to n.

func IP6ZoneToString

func IP6ZoneToString(zone int) string

IP6ZoneToString converts an IP6 Zone unix int to a net string returns "" if zone is 0

func Identity

func Identity(n int) int

Identity is identity.

func IsPowerOfTwo

func IsPowerOfTwo(n int) bool

IsPowerOfTwo reports whether given integer is a power of two.

func LogarithmicRange

func LogarithmicRange(min, max int, cb func(int))

LogarithmicRange iterates from ceiled to power of two min to max, calling cb on each iteration.

func SetKeepAlive

func SetKeepAlive(fd, secs int) error

SetKeepAlive ...

func SockaddrToIPAndZone

func SockaddrToIPAndZone(sa unix.Sockaddr) (net.IP, string)

SockaddrToIPAndZone converts a Sockaddr to a net.IP (with optional IPv6 Zone) Returns nil if conversion fails.

func SockaddrToTCPOrUnixAddr

func SockaddrToTCPOrUnixAddr(sa unix.Sockaddr) net.Addr

SockaddrToTCPOrUnixAddr converts a Sockaddr to a net.TCPAddr or net.UnixAddr. Returns nil if conversion fails.

func SockaddrToUDPAddr

func SockaddrToUDPAddr(sa unix.Sockaddr) *net.UDPAddr

SockaddrToUDPAddr converts a Sockaddr to a net.UDPAddr Returns nil if conversion fails.

func SockaddrToUnixAddr

func SockaddrToUnixAddr(sa unix.Sockaddr) *net.UnixAddr

SockaddrToUnixAddr converts a Sockaddr to a net.UnixAddr Returns nil if conversion fails.

Types

type Poller

type Poller struct {
	// contains filtered or unexported fields
}

Poller ...

func OpenPoller

func OpenPoller() *Poller

OpenPoller ...

func (*Poller) AddRead

func (p *Poller) AddRead(fd int)

AddRead ...

func (*Poller) AddReadWrite

func (p *Poller) AddReadWrite(fd int)

AddReadWrite ...

func (*Poller) Close

func (p *Poller) Close() error

Close ...

func (*Poller) ModDetach

func (p *Poller) ModDetach(fd int)

ModDetach ...

func (*Poller) ModRead

func (p *Poller) ModRead(fd int)

ModRead ...

func (*Poller) ModReadWrite

func (p *Poller) ModReadWrite(fd int)

ModReadWrite ...

func (*Poller) Polling

func (p *Poller) Polling(iter func(fd int, note interface{}) error) error

Polling ...

func (*Poller) Trigger

func (p *Poller) Trigger(note interface{}) error

Trigger ...

Jump to

Keyboard shortcuts

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