epoll

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFileAlreadyWatched error = errors.New("file being watched already")
	ErrInvalidEventType   error = errors.New("invalid event type")
	ErrWatcherNotFound    error = errors.New("watcher not found")
)

Functions

This section is empty.

Types

type Epoll

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

func New

func New(opts ...NewOpt) (Epoll, error)

func (*Epoll) AddWatcher

func (e *Epoll) AddWatcher(w Watcher) error

func (*Epoll) Close

func (e *Epoll) Close()

func (*Epoll) DeleteWatcher

func (e *Epoll) DeleteWatcher(fileName string) error

func (*Epoll) Start

func (e *Epoll) Start() (<-chan Event, error)

func (*Epoll) Stop

func (e *Epoll) Stop()

type Event

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

func (*Event) FileName

func (ev *Event) FileName() string

func (*Event) IsType

func (ev *Event) IsType(evt EventType) bool

type EventType

type EventType uint32
const (
	EPOLLIN  EventType = syscall.EPOLLIN
	EPOLLPRI EventType = syscall.EPOLLPRI
	EPOLLERR EventType = syscall.EPOLLERR
	EPOLLOUT EventType = syscall.EPOLLOUT
	EPOLLHUP EventType = syscall.EPOLLHUP
)

type NewOpt added in v1.7.0

type NewOpt func(*Epoll)

func BufferSize added in v1.7.0

func BufferSize(size int) NewOpt

type Watcher

type Watcher struct {

	// The complete path of the file to watch. The file name is also used to
	// uniquely identify the watcher
	FileName string
	// The event types to watch for
	EventTypes []EventType
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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