urja

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 13, 2021 License: MIT Imports: 2 Imported by: 0

README

urja

A general purpose Go wrapper over Mac's pmset command

Installation
go get github.com/A9u/urja
Usage
    // returns status of batteries and UPSs.
    output, err := urja.GetBatteryStatus()

    // run custom command, i.e, pass args to pmset
    output, err := urja.RunCustomCommand("-g", "therm")
    fmt.Println(output.String())

    // run man command on pmset
    output, err := urja.GetHelp()
    fmt.Println(output.String())
Functions available
  • GetBatteryStatus() returns string and error and is a wrapper for pmset -g ps
  • RunCustomCommand(args ...string) returns bytes.Buffer and error. Variable number of arguments can be passed.
  • GetHelp() returns bytes.Buffer and error. It is a wrapper for man pmset
Contributing

Feature requests are always welcome with accompanying PR(if possible 😉). Please file an issue if you are facing any challenges. Labels used are bug/question/enhancement

If there's anything you'd like to chat about, please feel free to reach me via twitter!

License

Copyright (c) 2021 Anusha Bhat Licensed under the MIT license.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBatteryStatus

func GetBatteryStatus() (status string, err error)

func GetHelp

func GetHelp() (output bytes.Buffer, err error)

func RunCustomCommand

func RunCustomCommand(args ...string) (output bytes.Buffer, err error)

Types

This section is empty.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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