fan

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2025 License: AGPL-3.0, MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ProcFsFd stores procfs self.
	ProcFsFd = "/proc/self/fd"
)

Variables

View Source
var (
	// ErrInit means fan init error.
	ErrInit = errors.New("fan: init error")

	// ErrVerMismatch means ver does not match the system ver.
	ErrVerMismatch = errors.New("fan: mismatched fan ver")
)

FAN

View Source
var (
	// ErrEventBinRead means event binary read error.
	ErrEventBinRead = errors.New("fan: event binary read error")

	// ErrEventClose means event close error.
	ErrEventClose = errors.New("fan: event close error")

	// ErrEventReadlink means event readlink error.
	ErrEventReadlink = errors.New("fan: event readlink error")
)

EVENTS

Functions

This section is empty.

Types

type EventMeta

type EventMeta struct {
	unix.FanotifyEventMetadata
}

EventMeta represents event metadata.

func (*EventMeta) Close

func (meta *EventMeta) Close() error

Close closes a eventmeta.

func (*EventMeta) File

func (meta *EventMeta) File() *os.File

File returns a *os.File from event meta.

func (*EventMeta) GetPath

func (meta *EventMeta) GetPath() (string, error)

GetPath returns the path from given eventmetadata.

func (*EventMeta) MatchMask

func (meta *EventMeta) MatchMask(mask int) bool

MatchMask checks if given eventmeta matches a given mask.

type Notify

type Notify struct {
	Fd     int
	File   *os.File
	Reader io.Reader
}

Notify represents a notify file handle.

func NewNotify

func NewNotify(notifyFlags uint, openFlags int) (*Notify, error)

NewNotify returns a notify.

func (*Notify) GetEvent

func (notify *Notify) GetEvent() (*EventMeta, error)

GetEvent returns an event.

func (*Notify) Mark

func (notify *Notify) Mark(flags uint, mask uint64, dirFd int, path string) error

Mark implements add / delete / modify for a mark.

Jump to

Keyboard shortcuts

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