libuv

package
v0.9.8 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

README

LLGo wrapper of libuv

How to install

on macOS (Homebrew)
brew install libuv
on Linux (Debian/Ubuntu)
apt-get install -y libuv1-dev
on Linux (CentOS/RHEL)
yum install -y libuv-devel
on Linux (Arch Linux)
pacman -S libuv

Demos

The _demo directory contains our demos (it start with _ to prevent the go command from compiling it):

How to run demos

To run the demos in directory _demo:

cd <demo-directory>  # eg. cd _demo/sqlitedemo
llgo run .

Documentation

Index

Constants

View Source
const (
	E2BIG           = Errno(syscall.E2BIG)
	EACCES          = Errno(syscall.EACCES)
	EADDRINUSE      = Errno(syscall.EADDRINUSE)
	EADDRNOTAVAIL   = Errno(syscall.EADDRNOTAVAIL)
	EAFNOSUPPORT    = Errno(syscall.EAFNOSUPPORT)
	EAGAIN          = Errno(syscall.EAGAIN)
	EALREADY        = Errno(syscall.EALREADY)
	EBADF           = Errno(syscall.EBADF)
	EBUSY           = Errno(syscall.EBUSY)
	ECANCELED       = Errno(syscall.ECANCELED)
	ECONNABORTED    = Errno(syscall.ECONNABORTED)
	ECONNREFUSED    = Errno(syscall.ECONNREFUSED)
	ECONNRESET      = Errno(syscall.ECONNRESET)
	EDESTADDRREQ    = Errno(syscall.EDESTADDRREQ)
	EEXIST          = Errno(syscall.EEXIST)
	EFAULT          = Errno(syscall.EFAULT)
	EFBIG           = Errno(syscall.EFBIG)
	EHOSTUNREACH    = Errno(syscall.EHOSTUNREACH)
	EINTR           = Errno(syscall.EINTR)
	EINVAL          = Errno(syscall.EINVAL)
	EIO             = Errno(syscall.EIO)
	EISCONN         = Errno(syscall.EISCONN)
	EISDIR          = Errno(syscall.EISDIR)
	ELOOP           = Errno(syscall.ELOOP)
	EMFILE          = Errno(syscall.EMFILE)
	EMSGSIZE        = Errno(syscall.EMSGSIZE)
	ENAMETOOLONG    = Errno(syscall.ENAMETOOLONG)
	ENETDOWN        = Errno(syscall.ENETDOWN)
	ENETUNREACH     = Errno(syscall.ENETUNREACH)
	ENFILE          = Errno(syscall.ENFILE)
	ENOBUFS         = Errno(syscall.ENOBUFS)
	ENODEV          = Errno(syscall.ENODEV)
	ENOENT          = Errno(syscall.ENOENT)
	ENOMEM          = Errno(syscall.ENOMEM)
	ENOPROTOOPT     = Errno(syscall.ENOPROTOOPT)
	ENOSPC          = Errno(syscall.ENOSPC)
	ENOSYS          = Errno(syscall.ENOSYS)
	ENOTCONN        = Errno(syscall.ENOTCONN)
	ENOTDIR         = Errno(syscall.ENOTDIR)
	ENOTEMPTY       = Errno(syscall.ENOTEMPTY)
	ENOTSOCK        = Errno(syscall.ENOTSOCK)
	ENOTSUP         = Errno(syscall.ENOTSUP)
	EOVERFLOW       = Errno(syscall.EOVERFLOW)
	EPERM           = Errno(syscall.EPERM)
	EPIPE           = Errno(syscall.EPIPE)
	EPROTO          = Errno(syscall.EPROTO)
	EPROTONOSUPPORT = Errno(syscall.EPROTONOSUPPORT)
	EPROTOTYPE      = Errno(syscall.EPROTOTYPE)
	ERANGE          = Errno(syscall.ERANGE)
	EROFS           = Errno(syscall.EROFS)
	ESHUTDOWN       = Errno(syscall.ESHUTDOWN)
	ESPIPE          = Errno(syscall.ESPIPE)
	ESRCH           = Errno(syscall.ESRCH)
	ETIMEDOUT       = Errno(syscall.ETIMEDOUT)
	ETXTBSY         = Errno(syscall.ETXTBSY)
	EXDEV           = Errno(syscall.EXDEV)
	ENXIO           = Errno(syscall.ENXIO)
	EMLINK          = Errno(syscall.EMLINK)
	EHOSTDOWN       = Errno(syscall.EHOSTDOWN)
	ENOTTY          = Errno(syscall.ENOTTY)
	//EFTYPE        = Errno(syscall.EFTYPE)
	EILSEQ          = Errno(syscall.EILSEQ)
	ESOCKTNOSUPPORT = Errno(syscall.ESOCKTNOSUPPORT)
)
View Source
const (
	EAI_ADDRFAMILY = Errno(net.EAI_ADDRFAMILY)
	EAI_AGAIN      = Errno(net.EAI_AGAIN)
	EAI_BADFLAGS   = Errno(net.EAI_BADFLAGS)
	EAI_BADHINTS   = Errno(net.EAI_BADHINTS)
	EAI_FAIL       = Errno(net.EAI_FAIL)
	EAI_FAMILY     = Errno(net.EAI_FAMILY)
	EAI_MEMORY     = Errno(net.EAI_MEMORY)
	EAI_NODATA     = Errno(net.EAI_NODATA)
	EAI_NONAME     = Errno(net.EAI_NONAME)
	EAI_OVERFLOW   = Errno(net.EAI_OVERFLOW)
	EAI_PROTOCOL   = Errno(net.EAI_PROTOCOL)
	EAI_SERVICE    = Errno(net.EAI_SERVICE)
	EAI_SOCKTYPE   = Errno(net.EAI_SOCKTYPE)
)
View Source
const (
	LLGoPackage = "link: $(pkg-config --libs libuv); -luv"
	LLGoFiles   = "$(pkg-config --cflags libuv): _wrap/libuv.c"
)

Variables

This section is empty.

Functions

func ErrName

func ErrName(err Errno) *c.Char

func ErrNameR

func ErrNameR(err Errno, buf *c.Char, bufLen uintptr) *c.Char

func Freeaddrinfo

func Freeaddrinfo(addrInfo *net.AddrInfo)

func FsAccess

func FsAccess(loop *Loop, req *Fs, path *c.Char, flags c.Int, cb FsCb) c.Int

func FsChmod

func FsChmod(loop *Loop, req *Fs, path *c.Char, mode c.Int, cb FsCb) c.Int

func FsChown

func FsChown(loop *Loop, req *Fs, path *c.Char, uid c.Int, gid c.Int, cb FsCb) c.Int

func FsClose

func FsClose(loop *Loop, req *Fs, file File, cb FsCb) c.Int

func FsCloseDir

func FsCloseDir(loop *Loop, req *Fs) c.Int

func FsCopyfile

func FsCopyfile(loop *Loop, req *Fs, path *c.Char, newPath *c.Char, flags c.Int, cb FsCb) c.Int

func FsEventInit

func FsEventInit(loop *Loop, handle *FsEvent) c.Int

func FsFchmod

func FsFchmod(loop *Loop, req *Fs, file File, mode c.Int, cb FsCb) c.Int

func FsFchown

func FsFchown(loop *Loop, req *Fs, file File, uid c.Int, gid c.Int, cb FsCb) c.Int

func FsFdatasync

func FsFdatasync(loop *Loop, req *Fs, file File, cb FsCb) c.Int

func FsFstat

func FsFstat(loop *Loop, req *Fs, file File, cb FsCb) c.Int

func FsFsync

func FsFsync(loop *Loop, req *Fs, file File, cb FsCb) c.Int

func FsFtruncate

func FsFtruncate(loop *Loop, req *Fs, file File, offset c.LongLong, cb FsCb) c.Int

func FsFutime

func FsFutime(loop *Loop, req *Fs, file File, atime c.Int, mtime c.Int, cb FsCb) c.Int

func FsLchown

func FsLchown(loop *Loop, req *Fs, path *c.Char, uid c.Int, gid c.Int, cb FsCb) c.Int
func FsLink(loop *Loop, req *Fs, path *c.Char, newPath *c.Char, cb FsCb) c.Int

func FsLstat

func FsLstat(loop *Loop, req *Fs, path *c.Char, cb FsCb) c.Int

func FsLutime

func FsLutime(loop *Loop, req *Fs, path *c.Char, atime c.Int, mtime c.Int, cb FsCb) c.Int

func FsMkStemp

func FsMkStemp(loop *Loop, req *Fs, tpl *c.Char, cb FsCb) c.Int

func FsMkdir

func FsMkdir(loop *Loop, req *Fs, path *c.Char, mode c.Int, cb FsCb) c.Int

func FsMkdtemp

func FsMkdtemp(loop *Loop, req *Fs, tpl *c.Char, cb FsCb) c.Int

func FsOpen

func FsOpen(loop *Loop, req *Fs, path *c.Char, flags c.Int, mode c.Int, cb FsCb) c.Int

func FsOpenDir

func FsOpenDir(loop *Loop, req *Fs, path *c.Char, cb FsCb) c.Int

func FsPollInit

func FsPollInit(loop *Loop, handle *FsPoll) c.Int

func FsRead

func FsRead(loop *Loop, req *Fs, file File, bufs *Buf, nbufs c.Uint, offset c.LongLong, cb FsCb) c.Int

func FsReaddir

func FsReaddir(loop *Loop, req *Fs, dir c.Int, cb FsCb) c.Int
func FsReadlink(loop *Loop, req *Fs, path *c.Char, cb FsCb) c.Int

func FsRealpath

func FsRealpath(loop *Loop, req *Fs, path *c.Char, cb FsCb) c.Int

func FsRename

func FsRename(loop *Loop, req *Fs, path *c.Char, newPath *c.Char, cb FsCb) c.Int

func FsRmdir

func FsRmdir(loop *Loop, req *Fs, path *c.Char, cb FsCb) c.Int

func FsScandir

func FsScandir(loop *Loop, req *Fs, path *c.Char, flags c.Int, cb FsCb) c.Int

func FsScandirNext

func FsScandirNext(req *Fs, ent *Dirent) c.Int

func FsSendfile

func FsSendfile(loop *Loop, req *Fs, outFd c.Int, inFd c.Int, inOffset c.LongLong, length c.Int, cb FsCb) c.Int

func FsStat

func FsStat(loop *Loop, req *Fs, path *c.Char, cb FsCb) c.Int

func FsStatfs

func FsStatfs(loop *Loop, req *Fs, path *c.Char, cb FsCb) c.Int
func FsSymlink(loop *Loop, req *Fs, path *c.Char, newPath *c.Char, flags c.Int, cb FsCb) c.Int
func FsUnlink(loop *Loop, req *Fs, path *c.Char, cb FsCb) c.Int

func FsUtime

func FsUtime(loop *Loop, req *Fs, path *c.Char, atime c.Int, mtime c.Int, cb FsCb) c.Int

func FsWrite

func FsWrite(loop *Loop, req *Fs, file File, bufs *Buf, nbufs c.Uint, offset c.LongLong, cb FsCb) c.Int

func Getaddrinfo

func Getaddrinfo(loop *Loop, req *GetAddrInfo, getaddrinfoCb GetaddrinfoCb, node *c.Char, service *c.Char, hints *net.AddrInfo) c.Int

func Getnameinfo

func Getnameinfo(loop *Loop, req *GetNameInfo, getnameinfoCb GetnameinfoCb, addr *net.SockAddr, flags c.Int) c.Int

func HandleSize

func HandleSize(handleType HandleType) uintptr

func HandleTypeName

func HandleTypeName(handleType HandleType) *c.Char

func InetNtop

func InetNtop(af c.Int, src c.Pointer, dst *c.Char, size uintptr) c.Int

func InetPton

func InetPton(af c.Int, src *c.Char, dst c.Pointer) c.Int

func InitCheck added in v0.9.7

func InitCheck(loop *Loop, Check *Check) c.Int

func InitIdle added in v0.9.7

func InitIdle(loop *Loop, idle *Idle) c.Int

func InitTcp

func InitTcp(loop *Loop, tcp *Tcp) c.Int

func InitTcpEx

func InitTcpEx(loop *Loop, tcp *Tcp, flags c.Uint) c.Int

func InitTimer

func InitTimer(loop *Loop, timer *Timer) c.Int

func InitUdp

func InitUdp(loop *Loop, udp *Udp) c.Int

func InitUdpEx

func InitUdpEx(loop *Loop, udp *Udp, flags c.Uint) c.Int

func Ip4Addr

func Ip4Addr(ip *c.Char, port c.Int, addr *net.SockaddrIn) c.Int

func Ip4Name

func Ip4Name(src *net.SockaddrIn, dst *c.Char, size uintptr) c.Int

func Ip6Addr

func Ip6Addr(ip *c.Char, port c.Int, addr *net.SockaddrIn6) c.Int

func Ip6Name

func Ip6Name(src *net.SockaddrIn6, dst *c.Char, size uintptr) c.Int

func IpName

func IpName(src *net.SockAddr, dst *c.Char, size uintptr) c.Int

func LibraryShutdown

func LibraryShutdown()

func LoopSize

func LoopSize() uintptr

func Pipe

func Pipe(fds [2]File, readFlags c.Int, writeFlags c.Int) c.Int

func PollInit

func PollInit(loop *Loop, handle *Poll, fd OsFd) c.Int

func PollInitSocket

func PollInitSocket(loop *Loop, handle *Poll, socket c.Int) c.Int

func QueueWork added in v0.9.8

func QueueWork(loop *Loop, req *Work, workCb WorkCb, afterWorkCb AfterWorkCb) c.Int

func ReplaceAllocator

func ReplaceAllocator(mallocFunc MallocFunc, reallocFunc ReallocFunc, callocFunc CallocFunc, freeFunc FreeFunc) c.Int

func ReqSize

func ReqSize(reqType ReqType) uintptr

func Send

func Send(req *UdpSend, udp *Udp, bufs *Buf, nbufs c.Uint, addr *net.SockAddr, sendCb UdpSendCb) c.Int

func SignalInit

func SignalInit(loop *Loop, handle *Signal) c.Int

func Socketpair

func Socketpair(_type c.Int, protocol c.Int, socketVector [2]OsSock, flag0 c.Int, flag1 c.Int) c.Int

func StreamShutdown added in v0.9.5

func StreamShutdown(shutdown *Shutdown, stream *Stream, shutdownCb ShutdownCb) c.Int

func Strerror

func Strerror(err Errno) *c.Char

func StrerrorR

func StrerrorR(err Errno, buf *c.Char, bufLen uintptr) *c.Char

func TcpConnect

func TcpConnect(req *Connect, tcp *Tcp, addr *net.SockAddr, connectCb ConnectCb) c.Int

func ThreadEqual added in v0.9.8

func ThreadEqual(t1 *Thread, t2 *Thread) c.Int

func ThreadGetCPU added in v0.9.8

func ThreadGetCPU() c.Int

func TypeName

func TypeName(reqType ReqType) *c.Char

func Version

func Version() c.Uint

func VersionString

func VersionString() *c.Char

Types

type AfterWorkCb added in v0.9.8

type AfterWorkCb func(req *Work, status c.Int)

type AllocCb

type AllocCb func(handle *Handle, suggestedSize uintptr, buf *Buf)

llgo:type C

type Async

type Async struct {
	Handle
	// On macOS arm64, sizeof uv_async_t is 128 bytes.
	// Handle is 92 bytes, so we need 36 bytes to fill the gap.
	// Maybe reserve more for future use.
	Unused [36]byte
}

struct uv_async_t

func (*Async) Send added in v0.9.5

func (a *Async) Send() c.Int

int uv_async_send(uv_async_t* async);

llgo:link (*Async).Send C.uv_async_send

type AsyncCb added in v0.9.5

type AsyncCb func(*Async)

typedef void (*uv_async_cb)(uv_async_t* handle); llgo:type C

type Buf

type Buf struct {
	Base *c.Char
	Len  uintptr

} // ----------------------------------------------

func InitBuf

func InitBuf(base *c.Char, len c.Uint) Buf

type CallocFunc

type CallocFunc func(count uintptr, size uintptr) c.Pointer

llgo:type C

type Check

type Check struct {
	Unused [120]byte
}

func (*Check) Start added in v0.9.7

func (Check *Check) Start(CheckCb CheckCb) c.Int

llgo:link (*Check).Start C.uv_check_start

func (*Check) Stop added in v0.9.7

func (Check *Check) Stop() c.Int

llgo:link (*Check).Stop C.uv_check_stop

type CheckCb added in v0.9.7

type CheckCb func(Check *Check)

llgo:type C

type CloseCb

type CloseCb func(handle *Handle)

llgo:type C

type Connect

type Connect struct {
	Data   c.Pointer
	Unused [88]byte
}

TODO(spongehah): Connect

type ConnectCb

type ConnectCb func(req *Connect, status c.Int)

llgo:type C

type ConnectionCb

type ConnectionCb func(server *Stream, status c.Int)

llgo:type C

type Dirent

type Dirent struct {
	Name *c.Char
	Type DirentType
}

type DirentType

type DirentType c.Int
const (
	DirentUnknown DirentType = iota
	DirentFile
	DirentDir
	DirentLink
	DirentFifo
	DirentSocket
	DirentChar
	DirentBlock
)

type Errno

type Errno c.Int
const (
	EAI_CANCELED Errno = -3003
	ECHARSET     Errno = -4080
	ENONET       Errno = -4056
	UNKNOWN      Errno = -4094
	EOF          Errno = -4095
	EREMOTEIO    Errno = -4030
	ERRNO_MAX    Errno = EOF - 1
)

func TranslateSysError

func TranslateSysError(sysErrno c.Int) Errno

type File

type File c.Int

type FreeFunc

type FreeFunc func(ptr c.Pointer)

llgo:type C

type Fs

type Fs struct {
	Unused [440]byte
}

func (*Fs) GetPath added in v0.9.5

func (req *Fs) GetPath() *c.Char

llgo:link (*Fs).GetPath C.uv_fs_get_path

func (*Fs) GetPtr added in v0.9.5

func (req *Fs) GetPtr() c.Pointer

llgo:link (*Fs).GetPtr C.uv_fs_get_ptr

func (*Fs) GetResult added in v0.9.5

func (req *Fs) GetResult() c.Int

llgo:link (*Fs).GetResult C.uv_fs_get_result

func (*Fs) GetStatBuf added in v0.9.5

func (req *Fs) GetStatBuf() *Stat

llgo:link (*Fs).GetStatBuf C.uv_fs_get_statbuf

func (*Fs) GetSystemError added in v0.9.5

func (req *Fs) GetSystemError() c.Int

llgo:link (*Fs).GetSystemError C.uv_fs_get_system_error

func (*Fs) GetType added in v0.9.5

func (req *Fs) GetType() FsType

llgo:link (*Fs).GetType C.uv_fs_get_type

func (*Fs) ReqCleanup added in v0.9.5

func (req *Fs) ReqCleanup()

llgo:link (*Fs).ReqCleanup C.uv_fs_req_cleanup

type FsCb

type FsCb func(req *Fs)

llgo:type C

type FsEvent

type FsEvent struct {
	Unused [0]byte
}

func (*FsEvent) Close added in v0.9.5

func (handle *FsEvent) Close() c.Int

llgo:link (*FsEvent).Close C.uv_fs_event_close

func (*FsEvent) Getpath added in v0.9.5

func (handle *FsEvent) Getpath() *c.Char

llgo:link (*FsEvent).Getpath C.uv_fs_event_getpath

func (*FsEvent) Start added in v0.9.5

func (handle *FsEvent) Start(cb FsEventCb, path *c.Char, flags c.Int) c.Int

llgo:link (*FsEvent).Start C.uv_fs_event_start

func (*FsEvent) Stop added in v0.9.5

func (handle *FsEvent) Stop() c.Int

llgo:link (*FsEvent).Stop C.uv_fs_event_stop

type FsEventCb

type FsEventCb func(handle *FsEvent, filename *c.Char, events c.Int, status c.Int)

llgo:type C

type FsPoll

type FsPoll struct {
	Unused [0]byte
}

func (*FsPoll) Close added in v0.9.5

func (handle *FsPoll) Close() c.Int

llgo:link (*FsPoll).Close C.uv_fs_poll_close

func (*FsPoll) GetPath added in v0.9.5

func (handle *FsPoll) GetPath() *c.Char

llgo:link (*FsPoll).GetPath C.uv_fs_poll_getpath

func (*FsPoll) Start added in v0.9.5

func (handle *FsPoll) Start(cb FsPollCb, path *c.Char, interval uint) c.Int

llgo:link (*FsPoll).Start C.uv_fs_poll_start

func (*FsPoll) Stop added in v0.9.5

func (handle *FsPoll) Stop() c.Int

llgo:link (*FsPoll).Stop C.uv_fs_poll_stop

type FsPollCb

type FsPollCb func(handle *FsPoll, status c.Int, events c.Int)

llgo:type C

type FsType

type FsType c.Int
const (
	FS_UNKNOWN   FsType = -1
	FS_CUSTOM    FsType = 0
	FS_OPEN      FsType = 1
	FS_CLOSE     FsType = 2
	FS_READ      FsType = 3
	FS_WRITE     FsType = 4
	FS_SENDFILE  FsType = 5
	FS_STAT      FsType = 6
	FS_LSTAT     FsType = 7
	FS_FSTAT     FsType = 8
	FS_FTRUNCATE FsType = 9
	FS_UTIME     FsType = 10
	FS_FUTIME    FsType = 11
	FS_ACCESS    FsType = 12
	FS_CHMOD     FsType = 13
	FS_FCHMOD    FsType = 14
	FS_FSYNC     FsType = 15
	FS_FDATASYNC FsType = 16
	FS_UNLINK    FsType = 17
	FS_RMDIR     FsType = 18
	FS_MKDIR     FsType = 19
	FS_MKDTEMP   FsType = 20
	FS_RENAME    FsType = 21
	FS_SCANDIR   FsType = 22
	FS_LINK      FsType = 23
	FS_SYMLINK   FsType = 24
	FS_READLINK  FsType = 25
	FS_CHOWN     FsType = 26
	FS_FCHOWN    FsType = 27
	FS_REALPATH  FsType = 28
	FS_COPYFILE  FsType = 29
	FS_LCHOWN    FsType = 30
	FS_OPENDIR   FsType = 31
	FS_READDIR   FsType = 32
	FS_CLOSEDIR  FsType = 33
	FS_STATFS    FsType = 34
	FS_MKSTEMP   FsType = 35
	FS_LUTIME    FsType = 36
)

type GetAddrInfo

type GetAddrInfo struct {
	Unused [160]byte
}

TODO(spongehah): GetAddrInfo

type GetNameInfo

type GetNameInfo struct {
	Unused [1320]byte
}

TODO(spongehah): GetNameInfo

type GetaddrinfoCb

type GetaddrinfoCb func(req *GetAddrInfo, status c.Int, res *net.AddrInfo)

llgo:type C

type GetnameinfoCb

type GetnameinfoCb func(req *GetNameInfo, status c.Int, hostname *c.Char, service *c.Char)

llgo:type C

type Handle

type Handle struct {
	Data   c.Pointer
	Unused [88]byte
}

TODO(spongehah): Handle

func (*Handle) Close

func (handle *Handle) Close(closeCb CloseCb)

llgo:link (*Handle).Close C.uv_close

func (*Handle) Fileno

func (handle *Handle) Fileno(fd *OsFd) c.Int

llgo:link (*Handle).Fileno C.uv_fileno

func (*Handle) GetData

func (handle *Handle) GetData() c.Pointer

llgo:link (*Handle).GetData C.uv_handle_get_data

func (*Handle) GetLoop

func (handle *Handle) GetLoop() *Loop

llgo:link (*Handle).GetLoop C.uv_handle_get_loop

func (*Handle) GetType

func (handle *Handle) GetType() HandleType

llgo:link (*Handle).GetType C.uv_handle_get_type

func (*Handle) HasRef

func (handle *Handle) HasRef() c.Int

llgo:link (*Handle).HasRef C.uv_has_ref

func (*Handle) IsActive

func (handle *Handle) IsActive() c.Int

llgo:link (*Handle).IsActive C.uv_is_active

func (*Handle) IsClosing

func (handle *Handle) IsClosing() c.Int

llgo:link (*Handle).IsClosing C.uv_is_closing

func (*Handle) IsReadable added in v0.9.5

func (handle *Handle) IsReadable() c.Int

llgo:link (*Handle).IsReadable C.uv_is_readable

func (*Handle) IsWritable added in v0.9.5

func (handle *Handle) IsWritable() c.Int

llgo:link (*Handle).IsWritable C.uv_is_writable

func (*Handle) RecvBufferSize

func (handle *Handle) RecvBufferSize(value *c.Int) c.Int

llgo:link (*Handle).RecvBufferSize C.uv_recv_buffer_size

func (*Handle) Ref

func (handle *Handle) Ref()

llgo:link (*Handle).Ref C.uv_ref

func (*Handle) SendBufferSize

func (handle *Handle) SendBufferSize(value *c.Int) c.Int

llgo:link (*Handle).SendBufferSize C.uv_send_buffer_size

func (*Handle) SetData

func (handle *Handle) SetData(data c.Pointer)

llgo:link (*Handle).SetData C.uv_handle_set_data

func (*Handle) Unref

func (handle *Handle) Unref()

llgo:link (*Handle).Unref C.uv_unref

type HandleType

type HandleType c.Int
const (
	UNKNOWN_HANDLE HandleType = iota
	ASYNC
	CHECK
	FS_EVENT
	FS_POLL
	HANDLE
	IDLE
	NAMED_PIPE
	POLL
	PREPARE
	PROCESS
	STREAM
	TCP
	TIMER
	TTY
	UDP
	SIGNAL
	FILE
	HANDLE_TYPE_MAX
)

type Idle

type Idle struct {
	Unused [120]byte
}

func (*Idle) Start added in v0.9.7

func (idle *Idle) Start(idleCb IdleCb) c.Int

llgo:link (*Idle).Start C.uv_idle_start

func (*Idle) Stop added in v0.9.7

func (idle *Idle) Stop() c.Int

llgo:link (*Idle).Stop C.uv_idle_stop

type IdleCb added in v0.9.7

type IdleCb func(idle *Idle)

llgo:type C

type Loop

type Loop struct {
	Unused [0]byte
}

func DefaultLoop

func DefaultLoop() *Loop

func LoopDefault

func LoopDefault() *Loop

llgo:link LoopDefault C.uv_default_loop

func LoopNew

func LoopNew() *Loop

llgo:link LoopNew C.uv_loop_new

func (*Loop) Alive added in v0.9.5

func (loop *Loop) Alive() c.Int

llgo:link (*Loop).Alive C.uv_loop_alive

func (*Loop) Async added in v0.9.5

func (loop *Loop) Async(a *Async, cb AsyncCb) c.Int

int uv_async_init(uv_loop_t*, uv_async_t* async, uv_async_cb async_cb);

llgo:link (*Loop).Async C.uv_async_init

func (*Loop) BackendFd added in v0.9.5

func (loop *Loop) BackendFd() c.Int

llgo:link (*Loop).BackendFd C.uv_backend_fd

func (*Loop) BackendTimeout added in v0.9.5

func (loop *Loop) BackendTimeout() c.Int

llgo:link (*Loop).BackendTimeout C.uv_backend_timeout

func (*Loop) Close added in v0.9.5

func (loop *Loop) Close() c.Int

llgo:link (*Loop).Close C.uv_loop_close

func (*Loop) Configure added in v0.9.5

func (loop *Loop) Configure(option LoopOption, arg c.Int) c.Int

llgo:link (*Loop).Configure C.uv_loop_configure

func (*Loop) Delete added in v0.9.5

func (loop *Loop) Delete() c.Int

llgo:link (*Loop).Delete C.uv_loop_delete

func (*Loop) Fork added in v0.9.5

func (loop *Loop) Fork() c.Int

llgo:link (*Loop).Fork C.uv_loop_fork

func (*Loop) GetData added in v0.9.8

func (loop *Loop) GetData() c.Pointer

llgo:link (*Loop).GetData C.uv_loop_get_data

func (*Loop) Init added in v0.9.5

func (loop *Loop) Init() c.Int

llgo:link (*Loop).Init C.uv_loop_init

func (*Loop) Now added in v0.9.5

func (loop *Loop) Now() c.UlongLong

llgo:link (*Loop).Now C.uv_now

func (*Loop) Run added in v0.9.5

func (loop *Loop) Run(mode RunMode) c.Int

llgo:link (*Loop).Run C.uv_run

func (*Loop) SetData added in v0.9.8

func (loop *Loop) SetData(data c.Pointer)

llgo:link (*Loop).SetData C.uv_loop_set_data

func (*Loop) Stop added in v0.9.5

func (loop *Loop) Stop()

void uv_stop(uv_loop_t *loop)

llgo:link (*Loop).Stop C.uv_stop

func (*Loop) UpdateTime added in v0.9.5

func (loop *Loop) UpdateTime()

llgo:link (*Loop).UpdateTime C.uv_update_time

func (*Loop) Walk added in v0.9.5

func (loop *Loop) Walk(walkCb WalkCb, arg c.Pointer)

llgo:link (*Loop).Walk C.uv_walk

type LoopOption

type LoopOption c.Int
const (
	LOOP_BLOCK_SIGNAL LoopOption = iota
	METRICS_IDLE_TIME
)

type MallocFunc

type MallocFunc func(size uintptr) c.Pointer

llgo:type C

type Membership

type Membership c.Int
const (
	UV_LEAVE_GROUP Membership = iota
	UV_JOIN_GROUP
)

type OsFd

type OsFd c.Int

type OsSock

type OsSock c.Int

type Poll

type Poll struct {
	Data   c.Pointer
	Unused [160]byte
}

func (*Poll) Start added in v0.9.5

func (handle *Poll) Start(events c.Int, cb PollCb) c.Int

llgo:link (*Poll).Start C.uv_poll_start

func (*Poll) Stop added in v0.9.5

func (handle *Poll) Stop() c.Int

llgo:link (*Poll).Stop C.uv_poll_stop

type PollCb

type PollCb func(handle *Poll, status c.Int, events c.Int)

llgo:type C

type PollEvent

type PollEvent c.Int
const (
	READABLE PollEvent = 1 << iota
	WRITABLE
	DISCONNECT
	PRIPRIORITIZED
)

type ReadCb

type ReadCb func(stream *Stream, nread c.Long, buf *Buf)

llgo:type C

type ReallocFunc

type ReallocFunc func(ptr c.Pointer, size uintptr) c.Pointer

llgo:type C

type Req

type Req struct {
	Unused [64]byte
}

TODO(spongehah): Req

func (*Req) Cancel added in v0.9.8

func (req *Req) Cancel() c.Int

llgo:link (*Req).Cancel C.uv_cancel

func (*Req) GetData

func (req *Req) GetData() c.Pointer

llgo:link (*Req).GetData C.uv_req_get_data

func (*Req) GetType

func (req *Req) GetType() ReqType

llgo:link (*Req).GetType C.uv_req_get_type

func (*Req) SetData

func (req *Req) SetData(data c.Pointer)

llgo:link (*Req).SetData C.uv_req_set_data

type ReqType

type ReqType c.Int
const (
	UNKNOWN_REQ ReqType = iota
	REQ
	CONNECT
	WRITE
	SHUTDOWN
	UDP_SEND
	FS
	WORK
	GETADDRINFO
	GETNAMEINFO
	RANDOM
	REQ_TYPE_PRIVATE
	REQ_TYPE_MAX
)

type RunMode

type RunMode c.Int
const (
	RUN_DEFAULT RunMode = iota
	RUN_ONCE
	RUN_NOWAIT
)

----------------------------------------------

type Shutdown

type Shutdown struct {
	Unused [80]byte
}

TODO(spongehah): Shutdown

type ShutdownCb

type ShutdownCb func(req *Shutdown, status c.Int)

llgo:type C

type Signal

type Signal struct {
	Unused [152]byte
}

func (*Signal) Start added in v0.9.5

func (handle *Signal) Start(cb SignalCb, signum c.Int) c.Int

llgo:link (*Signal).Start C.uv_signal_start

func (*Signal) StartOneshot added in v0.9.5

func (handle *Signal) StartOneshot(cb SignalCb, signum c.Int) c.Int

llgo:link (*Signal).StartOneshot C.uv_signal_start_oneshot

func (*Signal) Stop added in v0.9.5

func (handle *Signal) Stop() c.Int

llgo:link (*Signal).Stop C.uv_signal_stop

type SignalCb

type SignalCb func(handle *Signal, sigNum c.Int)

llgo:type C

type Stat

type Stat struct {
	Unused [0]byte
}

type Stream

type Stream struct {
	Data   c.Pointer
	Unused [256]byte
}

TODO(spongehah): Stream

func (*Stream) Accept

func (server *Stream) Accept(client *Stream) c.Int

llgo:link (*Stream).Accept C.uv_accept

func (*Stream) GetWriteQueueSize

func (stream *Stream) GetWriteQueueSize() uintptr

llgo:link (*Stream).GetWriteQueueSize C.uv_stream_get_write_queue_size

func (*Stream) IsReadable

func (stream *Stream) IsReadable() c.Int

llgo:link (*Stream).IsReadable C.uv_is_readable

func (*Stream) IsWritable

func (stream *Stream) IsWritable() c.Int

llgo:link (*Stream).IsWritable C.uv_is_writable

func (*Stream) Listen

func (stream *Stream) Listen(backlog c.Int, connectionCb ConnectionCb) c.Int

llgo:link (*Stream).Listen C.uv_listen

func (*Stream) SetBlocking

func (stream *Stream) SetBlocking(blocking c.Int) c.Int

llgo:link (*Stream).SetBlocking C.uv_stream_set_blocking

func (*Stream) StartRead

func (stream *Stream) StartRead(allocCb AllocCb, readCb ReadCb) c.Int

llgo:link (*Stream).StartRead C.uv_read_start

func (*Stream) StopRead

func (stream *Stream) StopRead() c.Int

llgo:link (*Stream).StopRead C.uv_read_stop

func (*Stream) TryWrite

func (stream *Stream) TryWrite(bufs *Buf, nbufs c.Uint) c.Int

llgo:link (*Stream).TryWrite C.uv_try_write

func (*Stream) TryWrite2

func (stream *Stream) TryWrite2(bufs *Buf, nbufs c.Uint, sendStream *Stream) c.Int

llgo:link (*Stream).TryWrite2 C.uv_try_write2

type Tcp

type Tcp struct {
	Data   c.Pointer
	Unused [256]byte
}

TODO(spongehah): Tcp

func (*Tcp) Bind

func (tcp *Tcp) Bind(addr *net.SockAddr, flags c.Uint) c.Int

llgo:link (*Tcp).Bind C.uv_tcp_bind

func (*Tcp) CloseReset

func (tcp *Tcp) CloseReset(closeCb CloseCb) c.Int

llgo:link (*Tcp).CloseReset C.uv_tcp_close_reset

func (*Tcp) GetIoWatcherFd added in v0.9.5

func (tcp *Tcp) GetIoWatcherFd() c.Int

llgo:link (*Tcp).GetIoWatcherFd C.uv_tcp_get_io_watcher_fd

func (*Tcp) Getpeername

func (tcp *Tcp) Getpeername(name *net.SockAddr, nameLen *c.Int) c.Int

llgo:link (*Tcp).Getpeername C.uv_tcp_getpeername

func (*Tcp) Getsockname

func (tcp *Tcp) Getsockname(name *net.SockAddr, nameLen *c.Int) c.Int

llgo:link (*Tcp).Getsockname C.uv_tcp_getsockname

func (*Tcp) KeepAlive

func (tcp *Tcp) KeepAlive(enable c.Int, delay c.Uint) c.Int

llgo:link (*Tcp).KeepAlive C.uv_tcp_keepalive

func (*Tcp) Nodelay

func (tcp *Tcp) Nodelay(enable c.Int) c.Int

llgo:link (*Tcp).Nodelay C.uv_tcp_nodelay

func (*Tcp) Open

func (tcp *Tcp) Open(sock OsSock) c.Int

llgo:link (*Tcp).Open C.uv_tcp_open

func (*Tcp) SimultaneousAccepts

func (tcp *Tcp) SimultaneousAccepts(enable c.Int) c.Int

llgo:link (*Tcp).SimultaneousAccepts C.uv_tcp_simultaneous_accepts

type TcpFlags

type TcpFlags c.Int
const (
	/* Used with uv_tcp_bind, when an IPv6 address is used. */
	TCP_IPV6ONLY TcpFlags = 1
)

type Thread added in v0.9.8

type Thread struct {
	Unused [8]byte
}

func ThreadSelf added in v0.9.8

func ThreadSelf() Thread

func (*Thread) Create added in v0.9.8

func (t *Thread) Create(entry ThreadCb, arg c.Pointer) c.Int

llgo:link (*Thread).Create C.uv_thread_create

func (*Thread) CreateEx added in v0.9.8

func (t *Thread) CreateEx(entry ThreadCb, params *ThreadOptions, arg c.Pointer) c.Int

llgo:link (*Thread).CreateEx C.uv_thread_create_ex

func (*Thread) GetAffinity added in v0.9.8

func (t *Thread) GetAffinity(cpuMask *c.Char, maskSize uintptr) c.Int

llgo:link (*Thread).GetAffinity C.uv_thread_get_affinity

func (*Thread) Join added in v0.9.8

func (t *Thread) Join() c.Int

llgo:link (*Thread).Join C.uv_thread_join

func (*Thread) SetAffinity added in v0.9.8

func (t *Thread) SetAffinity(cpuMask *c.Char, oldMask *c.Char, maskSize uintptr) c.Int

llgo:link (*Thread).SetAffinity C.uv_thread_set_affinity

type ThreadCb added in v0.9.8

type ThreadCb func(arg c.Pointer)

llgo:type C

type ThreadOptions added in v0.9.8

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

type Timer

type Timer struct {
	Unused [152]byte
}

TODO(spongehah): Timer

func (*Timer) Again

func (timer *Timer) Again() c.Int

llgo:link (*Timer).Again C.uv_timer_again

func (*Timer) GetDueIn

func (timer *Timer) GetDueIn() uint64

llgo:link (*Timer).GetDueIn C.uv_timer_get_due_in

func (*Timer) GetRepeat

func (timer *Timer) GetRepeat() uint64

llgo:link (*Timer).GetRepeat C.uv_timer_get_repeat

func (*Timer) SetRepeat

func (timer *Timer) SetRepeat(repeat uint64)

llgo:link (*Timer).SetRepeat C.uv_timer_set_repeat

func (*Timer) Start

func (timer *Timer) Start(cb TimerCb, timeoutMs uint64, repeat uint64) c.Int

llgo:link (*Timer).Start C.uv_timer_start

func (*Timer) Stop

func (timer *Timer) Stop() c.Int

llgo:link (*Timer).Stop C.uv_timer_stop

type TimerCb

type TimerCb func(timer *Timer)

llgo:type C

type Udp

type Udp struct {
	Unused [224]byte
}

TODO(spongehah): Udp

func (*Udp) Bind

func (udp *Udp) Bind(addr *net.SockAddr, flags c.Uint) c.Int

llgo:link (*Udp).Bind C.uv_udp_bind

func (*Udp) Connect

func (udp *Udp) Connect(addr *net.SockAddr) c.Int

llgo:link (*Udp).Connect C.uv_udp_connect

func (*Udp) GetSendQueueCount

func (udp *Udp) GetSendQueueCount() uintptr

llgo:link (*Udp).GetSendQueueCount C.uv_udp_get_send_queue_count

func (*Udp) GetSendQueueSize

func (udp *Udp) GetSendQueueSize() uintptr

llgo:link (*Udp).GetSendQueueSize C.uv_udp_get_send_queue_size

func (*Udp) Getpeername

func (udp *Udp) Getpeername(name *net.SockAddr, nameLen *c.Int) c.Int

llgo:link (*Udp).Getpeername C.uv_udp_getpeername

func (*Udp) Getsockname

func (udp *Udp) Getsockname(name *net.SockAddr, nameLen *c.Int) c.Int

llgo:link (*Udp).Getsockname C.uv_udp_getsockname

func (*Udp) Open

func (udp *Udp) Open(sock OsSock) c.Int

llgo:link (*Udp).Open C.uv_udp_open

func (*Udp) SetBroadcast

func (udp *Udp) SetBroadcast(on c.Int) c.Int

llgo:link (*Udp).SetBroadcast C.uv_udp_set_broadcast

func (*Udp) SetMembership

func (udp *Udp) SetMembership(multicastAddr *c.Char, interfaceAddr *c.Char, membership Membership) c.Int

llgo:link (*Udp).SetMembership C.uv_udp_set_membership

func (*Udp) SetMulticastInterface

func (udp *Udp) SetMulticastInterface(interfaceAddr *c.Char) c.Int

llgo:link (*Udp).SetMulticastInterface C.uv_udp_set_multicast_interface

func (*Udp) SetMulticastLoop

func (udp *Udp) SetMulticastLoop(on c.Int) c.Int

llgo:link (*Udp).SetMulticastLoop C.uv_udp_set_multicast_loop

func (*Udp) SetMulticastTTL

func (udp *Udp) SetMulticastTTL(ttl c.Int) c.Int

llgo:link (*Udp).SetMulticastTTL C.uv_udp_set_multicast_ttl

func (*Udp) SetTTL

func (udp *Udp) SetTTL(ttl c.Int) c.Int

llgo:link (*Udp).SetTTL C.uv_udp_set_ttl

func (*Udp) SourceMembership

func (udp *Udp) SourceMembership(multicastAddr *c.Char, interfaceAddr *c.Char, sourceAddr *c.Char, membership Membership) c.Int

llgo:link (*Udp).SourceMembership C.uv_udp_set_source_membership

func (*Udp) StartRecv

func (udp *Udp) StartRecv(allocCb AllocCb, recvCb UdpRecvCb) c.Int

llgo:link (*Udp).StartRecv C.uv_udp_recv_start

func (*Udp) StopRecv

func (udp *Udp) StopRecv() c.Int

llgo:link (*Udp).StopRecv C.uv_udp_recv_stop

func (*Udp) TrySend

func (udp *Udp) TrySend(bufs *Buf, nbufs c.Uint, addr *net.SockAddr) c.Int

llgo:link (*Udp).TrySend C.uv_udp_try_send

func (*Udp) UsingRecvmmsg

func (udp *Udp) UsingRecvmmsg() c.Int

llgo:link (*Udp).UsingRecvmmsg C.uv_udp_using_recvmmsg

type UdpFlags

type UdpFlags c.Int
const (
	/* Disables dual stack mode. */
	UDP_IPV6ONLY UdpFlags = 1
	/*
	 * Indicates message was truncated because read buffer was too small. The
	 * remainder was discarded by the OS. Used in uv_udp_recv_cb.
	 */
	UDP_PARTIAL UdpFlags = 2
	/*
	 * Indicates if SO_REUSEADDR will be set when binding the handle.
	 * This sets the SO_REUSEPORT socket flag on the BSDs and OS X. On other
	 * Unix platforms, it sets the SO_REUSEADDR flag.  What that means is that
	 * multiple threads or processes can bind to the same address without error
	 * (provided they all set the flag) but only the last one to bind will receive
	 * any traffic, in effect "stealing" the port from the previous listener.
	 */
	UDP_REUSEADDR UdpFlags = 4
	/*
	 * Indicates that the message was received by recvmmsg, so the buffer provided
	 * must not be freed by the recv_cb callback.
	 */
	UDP_MMSG_CHUNK UdpFlags = 8
	/*
	 * Indicates that the buffer provided has been fully utilized by recvmmsg and
	 * that it should now be freed by the recv_cb callback. When this flag is set
	 * in uv_udp_recv_cb, nread will always be 0 and addr will always be NULL.
	 */
	UDP_MMSG_FREE UdpFlags = 16
	/*
	 * Indicates if IP_RECVERR/IPV6_RECVERR will be set when binding the handle.
	 * This sets IP_RECVERR for IPv4 and IPV6_RECVERR for IPv6 UDP sockets on
	 * Linux. This stops the Linux kernel from suppressing some ICMP error
	 * messages and enables full ICMP error reporting for faster failover.
	 * This flag is no-op on platforms other than Linux.
	 */
	UDP_LINUX_RECVERR UdpFlags = 32
	/*
	 * Indicates that recvmmsg should be used, if available.
	 */
	UDP_RECVMMSG UdpFlags = 256
)

* UDP support.

type UdpRecvCb

type UdpRecvCb func(handle *Udp, nread c.Long, buf *Buf, addr *net.SockAddr, flags c.Uint)

llgo:type C

type UdpSend

type UdpSend struct {
	Unused [320]byte
}

TODO(spongehah): UdpSend

type UdpSendCb

type UdpSendCb func(req *UdpSend, status c.Int)

llgo:type C

type WalkCb

type WalkCb func(handle *Handle, arg c.Pointer)

llgo:type C

type Work added in v0.9.8

type Work struct {
	Unused [128]byte
}

type WorkCb added in v0.9.8

type WorkCb func(req *Work)

type Write

type Write struct {
	Data   c.Pointer
	Unused [184]byte
}

TODO(spongehah): Write

func (*Write) Write

func (req *Write) Write(stream *Stream, bufs *Buf, nbufs c.Uint, writeCb WriteCb) c.Int

llgo:link (*Write).Write C.uv_write

func (*Write) Write2

func (req *Write) Write2(stream *Stream, bufs *Buf, nbufs c.Uint, sendStream *Stream, writeCb WriteCb) c.Int

llgo:link (*Write).Write2 C.uv_write2

type WriteCb

type WriteCb func(req *Write, status c.Int)

llgo:type C

Directories

Path Synopsis
_demo

Jump to

Keyboard shortcuts

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