quota

package module
v0.0.0-...-01f1693 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2019 License: MIT Imports: 5 Imported by: 0

README

quota builds.sr.ht status GoDoc Go Report Card

Package quota provides access to Linux quota netlink notifications.

Quota notifications occur when a user or group's disk quota is exceeded, or when disk usage falls below a given quota.

For more information on quotas, please see https://www.kernel.org/doc/Documentation/filesystems/quota.txt.

MIT Licensed.

Documentation

Overview

Package quota provides access to Linux quota netlink notifications.

Quota notifications occur when a user or group's disk quota is exceeded, or when disk usage falls below a given quota.

For more information on quotas, please see https://www.kernel.org/doc/Documentation/filesystems/quota.txt.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

A Client provides access to Linux kobject userspace events. Clients are safe for concurrent use.

func New

func New() (*Client, error)

New creates a new Client.

func (*Client) Close

func (c *Client) Close() error

Close releases resources used by a Client.

func (*Client) Receive

func (c *Client) Receive() (*Notification, error)

Receive waits until a quota netlink notification is triggered, and then returns the Notification.

func (*Client) SetDeadline

func (c *Client) SetDeadline(t time.Time) error

SetDeadline sets the read deadline associated with the connection.

type Notification

type Notification struct {
	Type        Type
	ID          int
	Warning     Warning
	DeviceMajor int
	DeviceMinor int
	CausedID    int
}

A Notification is a disk quota notification.

type Type

type Type int

A Type is a quota type.

const (
	User    Type = 0
	Group   Type = 1
	Project Type = 2
)

Possible quota types.

func (Type) String

func (i Type) String() string

type Warning

type Warning int

A Warning is an individual event which caused a Notification to be sent.

const (
	None           Warning = 0
	InodeHard      Warning = 1
	InodeSoftLong  Warning = 2
	InodeSoft      Warning = 3
	BlockHard      Warning = 4
	BlockSoftLong  Warning = 5
	BlockSoft      Warning = 6
	InodeHardBelow Warning = 7
	InodeSoftBelow Warning = 8
	BlockHardBelow Warning = 9
	BlockSoftBelow Warning = 10
)

Possible Warning values. See the Linux quota documentation for details.

func (Warning) String

func (i Warning) String() string

Jump to

Keyboard shortcuts

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