service

package
v0.0.0-...-a60a39e Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2016 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package service defines a service unit type

Index

Constants

View Source
const DEFAULT_TYPE = "simple"

Variables

This section is empty.

Functions

func Supported

func Supported(typ string) (is bool)

Types

type Definition

type Definition struct {
	unit.Definition
	Service struct {
		Type                            string
		ExecStart, ExecStop, ExecReload string
		//Restart                         string
		//RestartSec                      int
		RemainAfterExit  bool
		WorkingDirectory string
	}
}

Service unit definition

type Unit

type Unit struct {
	Definition
	*exec.Cmd
}

Service unit

func (*Unit) Active

func (sv *Unit) Active() unit.Activation

Active reports activation status of a service

func (*Unit) Define

func (sv *Unit) Define(r io.Reader) (err error)

Define attempts to fill the sv definition by parsing r

func (*Unit) Start

func (sv *Unit) Start() (err error)

Start executes the command specified in service definition

func (*Unit) Stop

func (sv *Unit) Stop() (err error)

Stop stops execution of the command specified in service definition

func (*Unit) Sub

func (sv *Unit) Sub() string

Sub reports the sub status of a service

Jump to

Keyboard shortcuts

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