app

package
v0.0.0-...-25c8ee0 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FlagHost = &cli.StringFlag{
	Name:    "host",
	EnvVars: []string{"OHWM_HOST"},
	Value:   "127.0.0.1",
	Usage:   "open hardware monitor host [OSHW_HOST]",
}

FlagHost flag for host

View Source
var FlagInterface = &cli.StringFlag{
	Name:    "http",
	EnvVars: []string{"OHWM_HTTP"},
	Value:   ":9200",
	Usage:   "interface to serve http requests",
}

FlagInterface flag for host

View Source
var FlagPath = &cli.StringFlag{
	Name:    "path",
	EnvVars: []string{"OHWM_PATH"},
	Value:   "/data.json",
	Usage:   "open hardware monitor path (ie /data.json)",
}

FlagPath flag for path url

View Source
var FlagPort = &cli.IntFlag{
	Name:    "port",
	EnvVars: []string{"OHWM_PORT"},
	Value:   8085,
	Usage:   "open hardware port [OSHW_PORT]",
}

FlagPort flag for host

View Source
var FlagScheme = &cli.StringFlag{
	Name:    "scheme",
	EnvVars: []string{"OHWM_SCHEME"},
	Value:   "http",
	Usage:   "open hardware monitor scheme (http/https)",
}

FlagScheme flag for host

Functions

This section is empty.

Types

type App

type App struct {
	Client *client.Client
	Out    io.Writer
	// contains filtered or unexported fields
}

App context

func New

func New() *App

New returns instance of an app

func (*App) ActionMetrics

func (a *App) ActionMetrics(ctx *cli.Context) error

ActionMetrics serves http

func (*App) ActionPrint

func (a *App) ActionPrint(_ *cli.Context) error

ActionPrint prints api result

func (*App) Before

func (a *App) Before(ctx *cli.Context) error

Before sets up app

func (*App) HandleMetrics

func (a *App) HandleMetrics(resp http.ResponseWriter, req *http.Request)

HandleMetrics handler

func (*App) Run

func (a *App) Run(args []string) error

Run runs cli action

Jump to

Keyboard shortcuts

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