helper

package
v0.0.0-...-9a8fd51 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2013 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MAX_GONIT_RETRIES int = 10
View Source
var TestProcess string

Functions

func BuildBin

func BuildBin(path string, outputPath string) error

Given the path to a direcotry to build and given an optional output path, this will build the binary.

func Cleanup

func Cleanup(p *Process)

func CopyFile

func CopyFile(srcName, dstName string, mode os.FileMode)

func CreateGonitCfg

func CreateGonitCfg(numProcesses int, pname string, writePath string,
	procPath string, includeEvents bool) error

func CreateGonitSettings

func CreateGonitSettings(gonitPidfile string, gonitDir string, procDir string) *Settings

func CreateProcessGroupCfg

func CreateProcessGroupCfg(name string, dir string, pg *ProcessGroup) error

func DoesProcessExist

func DoesProcessExist(pid int) bool

Returns whether a given pid is running.

func FindLogLine

func FindLogLine(stdout io.ReadCloser, logline string, timeout string) bool

Given an stdout pipe, a logline to find and a timeout string, this will return whether the logline was printed or not.

func NewTestProcess

func NewTestProcess(name string, flags []string, detached bool) *Process

func ProxyReadPidFile

func ProxyReadPidFile(path string) (int, error)

Read pid from a file.

func ReadData

func ReadData(data interface{}, file string)

func RunGonitCmd

func RunGonitCmd(command string, path string) error

Given a gonit command string such as "start all", this will run the command. Path is used because we set custom pid file locations so the gonit client needs to know where the config files are for that.

func StartGonit

func StartGonit(configDir string) (*exec.Cmd, io.ReadCloser, error)

Given a config directory, this will start gonit, output the log messages and watch gonit to print out error messages.

func StopGonit

func StopGonit(gonitCmd *exec.Cmd, path string) error

This kills all processes gonit is running, then stops gonit. Path is used because we set custom pid file locations so the gonit client needs to know where the config files are for that.

func TouchFile

func TouchFile(name string, mode os.FileMode)

func WithRpcServer

func WithRpcServer(f func(c *rpc.Client)) error

func WriteData

func WriteData(data interface{}, file string)

Types

type ProcessInfo

type ProcessInfo struct {
	Ppid     int
	Pid      int
	Uid      int
	Euid     int
	Gid      int
	Egid     int
	Pgrp     int
	Sid      int
	Dir      string
	Groups   []int
	Args     []string
	Env      []string
	Restarts int
	HasTty   bool
}

func CurrentProcessInfo

func CurrentProcessInfo() *ProcessInfo

Jump to

Keyboard shortcuts

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