df

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package df implements a plugin to monitor disk usage and notify when low.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(b bot.Bot, alarms ...Alarm)

Register registers the plugin with a bot.

Types

type Alarm

type Alarm struct {
	Path  string
	Limit uint64
	// contains filtered or unexported fields
}

An Alarm represents a path and disk size limit (in bytes) when to notify. Notification happens once when limit is crossed then is reset if it goes back above the limit.

func NewAlarm

func NewAlarm(path string, limit size.Byte) Alarm

NewAlarm creates a new Alarm as specified.

func (*Alarm) Monitor

func (a *Alarm) Monitor(b bot.Bot)

Monitor monitors a path and notifies when limit is crossed.

func (*Alarm) Notify

func (a *Alarm) Notify(b bot.Bot, total, free uint64)

Notify notifies disk usage on all channels.

Jump to

Keyboard shortcuts

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