Documentation ¶
Index ¶
- func ByteSliceHasAnyPrefix(s []byte, prefixes ...string) bool
- func CleanUpProcessGroup(cmd *exec.Cmd)
- func DecorateError(code codes.Code, err error) error
- func ExitStatus(err error) (int, bool)
- func GetRepoPath(repo *pb.Repository) (string, error)
- func IsNumber(s []byte) bool
- func UnquoteBytes(s []byte) []byte
- type Command
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ByteSliceHasAnyPrefix ¶ added in v0.3.0
ByteSliceHasAnyPrefix tests whether the byte slice s begins with any of the prefixes.
func CleanUpProcessGroup ¶
CleanUpProcessGroup will send a SIGTERM signal to the process group belonging to the `cmd` process
func DecorateError ¶ added in v0.11.0
DecorateError unless it's already a grpc error.
If given nil it will return nil.
func ExitStatus ¶ added in v0.4.0
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. The errors returned are gRPC errors with relevant error codes and should be passed back to gRPC without further decoration.
func UnquoteBytes ¶ added in v0.9.0
UnquoteBytes removes surrounding double-quotes from a byte slice returning a new slice if they exist, otherwise it returns the same byte slice passed.
Types ¶
type Command ¶ added in v0.3.0
Command encapsulates operations with commands creates with NewCommand
func GitCommandReader ¶ added in v0.3.0
GitCommandReader creates a git Command with the given args