Documentation ¶
Index ¶
- func APIDoc(r *mux.Route, in, out interface{})
- func AvgCpuLoad() (*load.AvgStat, error)
- func ErrorResponse(header int, msg string, w http.ResponseWriter)
- func FormatFloat(v float64) string
- func GenerateCerts() error
- func JSONCreateResponse(i interface{}, fn func() error, w http.ResponseWriter, r *http.Request)
- func JSONDeleteResponse(fn func(string) error, w http.ResponseWriter, r *http.Request)
- func JSONGetResponse(fn func(string) (interface{}, error), w http.ResponseWriter, r *http.Request)
- func JSONGetUsage(usage Doer) http.HandlerFunc
- func JSONListResponse(fn func() (interface{}, error), w http.ResponseWriter, r *http.Request)
- func JSONResponse(payload interface{}, w http.ResponseWriter, r *http.Request)
- func JSONResponseWithStatus(httpStatus int, payload interface{}, w http.ResponseWriter, r *http.Request)
- func JSONUpdateResponse(i interface{}, fn func(string) error, w http.ResponseWriter, r *http.Request)
- func RoundToTwoDecimal(f float64) float64
- func SummarizeAPI()
- func SystemdExecute(name, command string, w bool) error
- type Auth
- type CalibrationConfiguration
- type CalibrationType
- type Calibrator
- type Credentials
- type Doer
- type ExecCommand
- type Measurement
- type TestRouter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AvgCpuLoad ¶
func ErrorResponse ¶
func ErrorResponse(header int, msg string, w http.ResponseWriter)
func FormatFloat ¶
func GenerateCerts ¶
func GenerateCerts() error
func JSONCreateResponse ¶
func JSONCreateResponse(i interface{}, fn func() error, w http.ResponseWriter, r *http.Request)
func JSONDeleteResponse ¶
func JSONGetResponse ¶
func JSONGetUsage ¶
func JSONGetUsage(usage Doer) http.HandlerFunc
func JSONListResponse ¶
func JSONListResponse(fn func() (interface{}, error), w http.ResponseWriter, r *http.Request)
func JSONResponse ¶
func JSONResponse(payload interface{}, w http.ResponseWriter, r *http.Request)
func JSONResponseWithStatus ¶
func JSONResponseWithStatus(httpStatus int, payload interface{}, w http.ResponseWriter, r *http.Request)
func JSONUpdateResponse ¶
func RoundToTwoDecimal ¶
RoundToTwoDecimal Round float64 to 2 decimals
func SummarizeAPI ¶
func SummarizeAPI()
func SystemdExecute ¶
Types ¶
type Auth ¶
type Auth interface { SignIn(http.ResponseWriter, *http.Request) SignOut(http.ResponseWriter, *http.Request) GetCredentials() (Credentials, error) UpdateCredentials(http.ResponseWriter, *http.Request) Me(http.ResponseWriter, *http.Request) Authenticate(http.HandlerFunc) http.HandlerFunc }
type CalibrationConfiguration ¶
type CalibrationConfiguration struct { Type CalibrationType `json:"Points"` Measurements []Measurement `json:"measurements"` }
type CalibrationType ¶
type CalibrationType int
const ( OnePointCalibration CalibrationType = iota + 1 TwoPointCalibration )
type Calibrator ¶
func CalibratorFactory ¶
func CalibratorFactory(config CalibrationConfiguration) (Calibrator, error)
type Credentials ¶
type ExecCommand ¶
type ExecCommand struct { DevMode bool // contains filtered or unexported fields }
func Command ¶
func Command(bin string, args ...string) *ExecCommand
func (*ExecCommand) CombinedOutput ¶
func (e *ExecCommand) CombinedOutput() ([]byte, error)
func (*ExecCommand) Run ¶
func (e *ExecCommand) Run() error
func (*ExecCommand) RunDetached ¶
func (e *ExecCommand) RunDetached() error
func (*ExecCommand) WithDevMode ¶
func (e *ExecCommand) WithDevMode(b bool) *ExecCommand
type Measurement ¶
type TestRouter ¶
func NewTestRouter ¶
func NewTestRouter() *TestRouter
Click to show internal directories.
Click to hide internal directories.