libuv

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 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"
)

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 UvFile, 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 FsEventClose

func FsEventClose(handle *FsEvent) c.Int

func FsEventGetpath

func FsEventGetpath(handle *FsEvent) *c.Char

func FsEventInit

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

func FsEventStart

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

func FsEventStop

func FsEventStop(handle *FsEvent) c.Int

func FsFchmod

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

func FsFchown

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

func FsFdatasync

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

func FsFstat

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

func FsFsync

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

func FsFtruncate

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

func FsFutime

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

func FsGetPath

func FsGetPath(req *Fs) *c.Char

func FsGetPtr

func FsGetPtr(req *Fs) c.Pointer

func FsGetResult

func FsGetResult(req *Fs) c.Int

func FsGetSystemError

func FsGetSystemError(req *Fs) 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 FsPollClose

func FsPollClose(handle *FsPoll) c.Int

func FsPollGetPath

func FsPollGetPath(handle *FsPoll) *c.Char

func FsPollInit

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

func FsPollStart

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

func FsPollStop

func FsPollStop(handle *FsPoll) c.Int

func FsRead

func FsRead(loop *Loop, req *Fs, file UvFile, 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 FsReqCleanup

func FsReqCleanup(req *Fs)

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 UvFile, 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 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 LoopAlive

func LoopAlive(loop *Loop) c.Int

func LoopBackendFd

func LoopBackendFd(loop *Loop) c.Int

func LoopBackendTimeout

func LoopBackendTimeout(loop *Loop) c.Int

func LoopClose

func LoopClose(loop *Loop) c.Int

func LoopConfigure

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

func LoopDelete

func LoopDelete(loop *Loop) c.Int

func LoopFork

func LoopFork(loop *Loop) c.Int

func LoopInit

func LoopInit(loop *Loop) c.Int

func LoopNow

func LoopNow(loop *Loop) c.UlongLong

func LoopSize

func LoopSize() uintptr

func LoopUpdateTime

func LoopUpdateTime(loop *Loop)

func LoopWalk

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

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 PollStart

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

func PollStop

func PollStop(handle *Poll) c.Int

func ReplaceAllocator

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

func ReqSize

func ReqSize(reqType ReqType) uintptr

func Run

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

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 SignalStart

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

func SignalStartOneshot

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

func Socketpair

func Socketpair(_type c.Int, protocol c.Int, socketVector [2]OsSock, flag0 c.Int, flag1 c.Int) 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 TypeName

func TypeName(reqType ReqType) *c.Char

func UvPipe

func UvPipe(fds [2]UvFile, readFlags c.Int, writeFlags c.Int) c.Int

func Version

func Version() c.Uint

func VersionString

func VersionString() *c.Char

Types

type AllocCb

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

llgo:type C

type Async

type Async struct {
	Unused [0]byte
}

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 [0]byte
}

type CloseCb

type CloseCb func(handle *Handle)

llgo:type C

type Connect

type Connect struct {
	Unused [0]byte
}

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 Dir

type Dir struct {
	Unused [0]byte
}

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 = -1
	EREMOTEIO    Errno = -4030
	ERRNO_MAX    Errno = EOF - 1
)

func TranslateSysError

func TranslateSysError(sysErrno c.Int) Errno

type File

type File struct {
	Loop *Loop
	Req  *Fs
}

type FreeFunc

type FreeFunc func(ptr c.Pointer)

llgo:type C

type Fs

type Fs struct {
	Unused [0]byte
}

type FsCb

type FsCb func(req *Fs)

llgo:type C

type FsEvent

type FsEvent struct {
	Unused [0]byte
}

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
}

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
)

func FsGetType

func FsGetType(req *Fs) *FsType

type GetAddrInfo

type GetAddrInfo struct {
	Unused [0]byte
}

type GetNameInfo

type GetNameInfo struct {
	Unused [0]byte
}

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 {
	Unused [96]byte
}

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) 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 [0]byte
}

type Loop

type Loop struct {
	Unused [0]byte
}

func DefaultLoop

func DefaultLoop() *Loop

func LoopDefault

func LoopDefault() *Loop

func LoopNew

func LoopNew() *Loop

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 Pipe

type Pipe struct {
	Unused [0]byte
}

type Poll

type Poll struct {
	Unused [0]byte
}

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 Prepare

type Prepare struct {
	Unused [0]byte
}

type Process

type Process struct {
	Unused [0]byte
}

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 [0]byte
}

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_handle_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 [0]byte
}

func (*Shutdown) Shutdown

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

llgo:link (*Shutdown).Shutdown C.uv_shutdown

type ShutdownCb

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

llgo:type C

type Signal

type Signal struct {
	Unused [0]byte
}

type SignalCb

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

llgo:type C

type Stat

type Stat struct {
	Unused [0]byte
}

func FsGetStatBuf

func FsGetStatBuf(req *Fs) *Stat

type Stream

type Stream struct {
	Unused [264]byte
}

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 {
	Unused [264]byte
}

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) 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 Timer

type Timer struct {
	Unused [0]byte
}

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, timeout 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 Cgit

type Tty

type Tty struct {
	Unused [0]byte
}

type Udp

type Udp struct {
	Unused [0]byte
}

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 [0]byte
}

type UdpSendCb

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

llgo:type C

type UvFile

type UvFile c.Int

type WalkCb

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

llgo:type C

type Write

type Write struct {
	Unused [192]byte
}

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
async_fs command
echo_server command

Jump to

Keyboard shortcuts

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