github.com/sunvim/utils@v0.1.0/netpoll/poll.go (about) 1 // Copyright (c) 2020 Meng Huang (mhboy@outlook.com) 2 // This package is licensed under a MIT license that can be found in the LICENSE file. 3 4 // Package netpoll implements a network poller based on epoll/kqueue. 5 package netpoll 6 7 // Mode represents the read/write mode. 8 type Mode int 9 10 const ( 11 // READ is the read mode. 12 READ Mode = 1 << iota 13 // WRITE is the write mode. 14 WRITE 15 ) 16 17 // Event represents the poll event for the poller. 18 type Event struct { 19 // Fd is a file descriptor. 20 Fd int 21 // Mode represents the event mode. 22 Mode Mode 23 }