Versions in this module Expand all Collapse all v1 v1.1.3 Dec 16, 2019 Changes in this version + const DefaultIOEvtLoopBufferSize + const SO_REUSEPORT — linux/amd64 + const TmFdCloexec + const TmFdNonblock + const TmFdTimerAbstime + var Debug = false + func ClockGetTime(clockId ClockId) (*unix.Timespec, error) + func MakeIpcSockpair(nonblock bool) (fds [2]int, err error) + func Spawn(exePath string, extraFd int) (*exec.Cmd, error) + func TimerFdCreate(clockId ClockId, flags int) (int, error) + func TimerFdGetTime(fd int, curr *ITimerSpec) error + func TimerFdSetTime(fd int, flags int, new *ITimerSpec, old *ITimerSpec) error + func WOULDBLOCK(err error) bool — linux/amd64 + type BaseUserData struct + func (this *BaseUserData) GetUserData() interface{} + func (this *BaseUserData) SetUserData(data interface{}) + type Bucket std.Set + type BucketEntry interface + GetRefCounter func() *int32 + type BufferedStream struct + func NewBufferedClientStream(loop *IOEvtLoop, fd int, onRead BufferedStreamOnRead) *BufferedStream + func NewBufferedConnStream(loop *IOEvtLoop, fd int, onRead BufferedStreamOnRead) *BufferedStream + type BufferedStreamOnRead func(sw StreamWriter, buf std.ReadableBuffer) + type ClockId int + const ClockMonotonic + const ClockRealtime + type Epoll struct — linux/amd64 + func (this *Epoll) AddFd(fd int, event uint32, watcher EventWatcher) error + func (this *Epoll) Close() error + func (this *Epoll) DelFd(fd int) error + func (this *Epoll) ModFd(fd int, event uint32) error + func (this *Epoll) Poll(msec int) error + func (this *Epoll) WatcherCtl(action PollerAction, watcher EventWatcher) error + type EventLoop interface + Break func() + Notify func() + Poller func() Poller + Run func(ctx context.Context) + RunInLoop func(cb func()) + func NewEventLoop() (EventLoop, error) + func NewEventLoop2(poller Poller) (EventLoop, error) + type EventWatcher interface + GetEvent func() uint32 + GetFd func() int + OnEvent func(event uint32) + SetEvent func(event uint32) + Update func(inLoop bool) + type Fd int — linux/amd64 + func (this Fd) Cloexec(enable bool) error + func (this Fd) Close() error + func (this Fd) FcntlGetFlag() (flags int, err error) + func (this Fd) FcntlSetFlag(flag int) (err error) + func (this Fd) NoneBlock(enable bool) error + type FdWatcher struct + func NewFdWatcher(loop EventLoop, fd int, watcher IOWatcher) *FdWatcher + func (this *FdWatcher) Close() error + func (this *FdWatcher) DisableRW() (update bool) + func (this *FdWatcher) DisableRead() (update bool) + func (this *FdWatcher) DisableWrite() (update bool) + func (this *FdWatcher) GetEvent() uint32 + func (this *FdWatcher) GetFd() int + func (this *FdWatcher) Loop() EventLoop + func (this *FdWatcher) SetEvent(event uint32) + func (this *FdWatcher) SetWatcher(watcher IOWatcher) + func (this *FdWatcher) Start() + func (this *FdWatcher) Update(inLoop bool) + func (this *FdWatcher) WantRead() (update bool) + func (this *FdWatcher) WantWrite() (update bool) + type IOEvtLoop struct + func NewIOEvtLoop(ioBufferSize int) (*IOEvtLoop, error) + type IOWatcher interface + DisableRW func() (update bool) + DisableRead func() (update bool) + DisableWrite func() (update bool) + Loop func() EventLoop + WantRead func() (update bool) + WantWrite func() (update bool) + type ITimerSpec struct + ItInterval unix.Timespec + ItValue unix.Timespec + type Listener struct + func NewListener(loop EventLoop, fd int, onAccept ListenerOnAccept) *Listener + func (this *Listener) OnEvent(event uint32) + type ListenerOnAccept func(ln *Listener, newFd int, err error) + type NotifyWatcher struct + func NewNotifyWatcher(loop EventLoop, wakeupCb func()) (*NotifyWatcher, error) + func (this *NotifyWatcher) GetEvent() uint32 + func (this *NotifyWatcher) Notify() + func (this *NotifyWatcher) OnEvent(event uint32) + func (this *NotifyWatcher) SetEvent(event uint32) + type Poller interface + Poll func(msec int) error + WatcherCtl func(action PollerAction, watcher EventWatcher) error + func NewEpoll(pollSize int) (Poller, error) + type PollerAction int + const Add + const Del + const Mod + type SockFd int — linux/amd64 + func NewConnFd(addrS string) (SockFd, error) + func NewConnFd2(version int, sockAddr unix.Sockaddr) (SockFd, error) + func NewListenerFd(addrS string, backLog int, reuseAddr, reusePort bool) (SockFd, error) + func NewListenerFd2(version int, sockAddr unix.Sockaddr, backLog int, reuseAddr, reusePort bool) (SockFd, error) + func NewTcpSocketFd(version int, nonblock bool, cloexec bool) (SockFd, error) + func (this SockFd) Accept(flags int) (nfd int, sa unix.Sockaddr, err error) + func (this SockFd) Bind(sockAddr unix.Sockaddr) error + func (this SockFd) Connect(addr unix.Sockaddr) error + func (this SockFd) Listen(backLog int) error + func (this SockFd) ReuseAddr(enable bool) error + func (this SockFd) ReusePort(enable bool) error + type SpinLock struct + func NewLockedSpinLock() *SpinLock + func NewSpinLock() *SpinLock + func (this *SpinLock) Lock() + func (this *SpinLock) Unlock() + type Stream struct + func NewClientStream(loop *IOEvtLoop, fd int, rcb StreamOnRead) *Stream + func NewConnStream(loop *IOEvtLoop, fd int, rcb StreamOnRead) *Stream + func (this *Stream) Close() error + func (this *Stream) OnEvent(event uint32) + func (this *Stream) SetOnClose(cb StreamOnClose) + func (this *Stream) SetOnConnect(cb StreamOnConnect) + func (this *Stream) Write(data []byte, inLoop bool) + type StreamMode int + const ModeClient + const ModeConn + type StreamOnClose func(sw StreamWriter, err error) + type StreamOnConnect func(sw StreamWriter, err error) + type StreamOnRead func(sw StreamWriter, data []byte, len int) + type StreamWriter interface + Write func(data []byte, inLoop bool) + type SyscallSockAddr struct — linux/amd64 + Version int + func ResolveTcpAddr(addrS string) (*SyscallSockAddr, error) + type TimeWheel struct + func NewTimeWheel(partTimeout, partCount uint16) *TimeWheel + func (this *TimeWheel) Entries() chan<- BucketEntry + func (this *TimeWheel) Execute(ctx context.Context) + type Timer struct + func NewTimerWatcher(loop EventLoop, clockId ClockId, onTick TimerOnTick) (*Timer, error) + func (this *Timer) OnEvent(event uint32) + func (this *Timer) StartTimer(delayMs int, intervalMs int) error + func (this *Timer) Stop() error + type TimerOnTick func(*Timer) + type UnknownAFError string — linux/amd64 + func (e UnknownAFError) Error() string + type UserDataStorage interface + GetUserData func() interface{} + SetUserData func(interface{}) v1.0.2 Jul 24, 2019