uptime

package
v0.0.0-...-2d83fc9 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2017 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package uptime gets the system's uptime using syscall.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTicker

func NewTicker(d time.Duration) (joe.Tocker, error)

NewTicker returns a new Ticker containing a Data channel that delivers the data at intervals and an error channel that delivers any errors encountered. Stop the ticker to signal the ticker to stop running. Stopping the ticker does not close the Data channel; call Close to close both the ticker and the data channel.

Types

type Ticker

type Ticker struct {
	*joe.Ticker
	Data chan Uptime
}

Ticker deliivers the uptime at intervals.

func (*Ticker) Close

func (t *Ticker) Close()

Close closes the ticker resources.

func (*Ticker) Run

func (t *Ticker) Run()

Run runs the ticker.

type Uptime

type Uptime struct {
	Timestamp int64
	Uptime    int64 // sorry for the stutter
}

Uptime holds the current uptime and timestamp.

func Get

func Get() (u Uptime, err error)

Get gets the current uptime information.

func (*Uptime) Get

func (u *Uptime) Get() error

Get gets the current uptime information.

Directories

Path Synopsis
Package uptime gets the system's uptime using syscall.
Package uptime gets the system's uptime using syscall.
Package uptime gets the system's uptime using syscall.
Package uptime gets the system's uptime using syscall.

Jump to

Keyboard shortcuts

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