helper

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2017 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ByteSliceHasAnyPrefix added in v0.3.0

func ByteSliceHasAnyPrefix(s []byte, prefixes ...string) bool

ByteSliceHasAnyPrefix tests whether the byte slice s begins with any of the prefixes.

func CleanUpProcessGroup

func CleanUpProcessGroup(cmd *exec.Cmd)

CleanUpProcessGroup will send a SIGTERM signal to the process group belonging to the `cmd` process

func ExitStatus added in v0.4.0

func ExitStatus(err error) (int, bool)

ExitStatus will return the exit-code from an error

func GetRepoPath added in v0.5.0

func GetRepoPath(repo *pb.Repository) (string, error)

GetRepoPath returns the full path of the repository referenced by an RPC Repository message.

func GitCommand added in v0.3.0

func GitCommand(name string, args ...string) *exec.Cmd

GitCommand returns a Cmd that's ready to be run by Cmd.Run. It sets the proper environment variables along with other tweaks.

func IsNumber added in v0.4.0

func IsNumber(s []byte) bool

IsNumber tests whether the byte slice s contains only digits or not

Types

type Command added in v0.3.0

type Command struct {
	io.Reader
	*exec.Cmd
}

Command encapsulates operations with commands creates with NewCommand

func GitCommandReader added in v0.3.0

func GitCommandReader(args ...string) (*Command, error)

GitCommandReader creates a git Command with the given args

func NewCommand added in v0.3.0

func NewCommand(cmd *exec.Cmd) (*Command, error)

NewCommand creates a Command from an exec.Cmd

func (*Command) Kill added in v0.3.0

func (c *Command) Kill()

Kill cleans the subprocess group of the command. Callers should defer a call to kill after they get the command from NewCommand

Jump to

Keyboard shortcuts

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