system

package
v0.0.0-...-7296e18 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2017 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

The system Pacakge is a utility pacakge meant to interface with system operations like opening an application or setting the clipboard text

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetClipboardText

func GetClipboardText() (string, error)

GetClipboardText returns a string of the clipboard text. It may return an error if unable to get the contents.

func GetOS

func GetOS() string

GetOS will return runtime.GOOS this is the running program's operating system target: one of darwin, freebsd, linux, and so on.

func GetProcessorCount

func GetProcessorCount() int

GetProcessorCount returns the number of logical CPUs usable by the current process.

func OpenUrl

func OpenUrl(url string)

OpenUrl will open a file, directory, or URI using the OS's default application for that object type.

See github.com/skratchdot/open-golang

func SetClipboardText

func SetClipboardText(str string) error

SetClipboardText will attempt to set the clipboard text with the provided string. It will return an error if it was unable to.

Types

type PowerState

type PowerState int

PowerState defines the battery connection to the PC

const (
	POWERSTATE_UNKNOWN    PowerState = sdl.POWERSTATE_UNKNOWN
	POWERSTATE_ON_BATTERY PowerState = sdl.POWERSTATE_ON_BATTERY
	POWERSTATE_NO_BATTERY PowerState = sdl.POWERSTATE_NO_BATTERY
	POWERSTATE_CHARGING   PowerState = sdl.POWERSTATE_CHARGING
	POWERSTATE_CHARGED    PowerState = sdl.POWERSTATE_CHARGED
)

func GetPowerInfo

func GetPowerInfo() (PowerState, int, int)

GetPowerInfo will return the PowerSate, seconds of battery left, and percentage of battery power.

Jump to

Keyboard shortcuts

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