hook

package
v2.0.0-alpha3+incompat... Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2015 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HOOK_SUCCESS                = 0
	HOOK_DOES_NOT_EXIST         = -1
	HOOK_STAT_FAILED            = -2
	HOOK_CANNOT_GET_EXIT_STATUS = -3
	HOOK_INVALID_NAME           = -4
	HOOK_VTROOT_ERROR           = -5
)

the hook will return a value between 0 and 255. 0 if it succeeds. so we have these additional values here for more information.

Variables

This section is empty.

Functions

This section is empty.

Types

type Hook

type Hook struct {
	Name       string
	Parameters []string
	ExtraEnv   map[string]string
}

func NewHook

func NewHook(name string, params []string) *Hook

func NewSimpleHook

func NewSimpleHook(name string) *Hook

func (*Hook) Execute

func (hook *Hook) Execute() (result *HookResult)

func (*Hook) ExecuteOptional

func (hook *Hook) ExecuteOptional() error

Execute an optional hook, returns a printable error

type HookResult

type HookResult struct {
	ExitStatus int // HOOK_SUCCESS if it succeeded
	Stdout     string
	Stderr     string
}

func (*HookResult) String

func (hr *HookResult) String() string

String returns a printable version of the HookResult

Jump to

Keyboard shortcuts

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