watchdog

package module
v0.0.0-...-556e846 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2022 License: MIT Imports: 4 Imported by: 0

README

watchdog Linux Test Status GoDoc Go Report Card

Package watchdog implements control of hardware watchdog devices. MIT Licensed.

Documentation

Overview

Package watchdog implements control of hardware watchdog devices.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Device

type Device struct {
	// Identity is the name of the watchdog driver.
	Identity string
	// contains filtered or unexported fields
}

A Device is a hardware watchdog device which can be pinged to keep the system from rebooting once the device has been opened.

func Open

func Open(device_path string) (*Device, error)

Open opens the primary watchdog device on this system ("/dev/watchdog" on Linux, TBD on other platforms). If the device is not found, an error compatible with os.ErrNotExist will be returned.

Once a Device is opened, you must call Ping repeatedly to keep the system from being rebooted. Call Close to disarm the watchdog device.

func (*Device) Close

func (d *Device) Close() error

Close closes the handle to the watchdog device and attempts to gracefully disarm the device, so no further Ping calls are required to keep the system from rebooting.

func (*Device) Ping

func (d *Device) Ping() error

Ping pings the watchdog device to keep the device from rebooting the system.

func (*Device) Timeout

func (d *Device) Timeout() (time.Duration, error)

Timeout returns the configured timeout of the watchdog device.

Directories

Path Synopsis
cmd
watchdog
Command watchdog is a demo application which shows usage of the package watchdog APIs.
Command watchdog is a demo application which shows usage of the package watchdog APIs.

Jump to

Keyboard shortcuts

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