api

package
v0.0.0-...-7e8c65f Latest Latest
Warning

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

Go to latest
Published: May 3, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Health

func Health(w http.ResponseWriter, r *http.Request)

Health function check whether systemd unit is running

func Index

func Index(w http.ResponseWriter, r *http.Request)

Index function for serving API index

func Logger

func Logger(inner http.Handler, name string) http.Handler

Logger fucntion to enable logging handler

func NewRouter

func NewRouter() *mux.Router

NewRouter fucntions creates for mux

func RestartUnit

func RestartUnit(w http.ResponseWriter, r *http.Request)

RestartUnit function restarts systemd service which is configured in conf.yaml

func StartUnit

func StartUnit(w http.ResponseWriter, r *http.Request)

StartUnit function starts systemd service which is configured in conf.yaml

func StopUnit

func StopUnit(w http.ResponseWriter, r *http.Request)

StopUnit function stops systemd service which is configured in conf.yaml

Types

type Route

type Route struct {
	Name        string
	Method      string
	Pattern     string
	HandlerFunc http.HandlerFunc
}

type Routes

type Routes []Route

Jump to

Keyboard shortcuts

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