Documentation
¶
Overview ¶
Package clam implements templated shell calls. It supports interop between go programs and the shell. You can parameterize an arbitrary shell command with values from you go program. If your command writes to a file, you can access this file instantly in you go program.
Simple example:
err := clam.Run("echo Hello {{ name }}", clam.Map{"name": "World"})
More examples can be found in the examples directory:
Index ¶
Constants ¶
View Source
const ( // DefaultShell is the shell program used for all commands. DefaultShell = "/bin/bash" // Version of library. Version = "0.1.0" )
Variables ¶
This section is empty.
Functions ¶
func RunFile ¶
RunFile a templated command with a given parameter map. Return the output as file object.
Types ¶
type Runner ¶
Runner implements various functions above cmd.Run().
func NewRunnerTimeout ¶
NewRunnerTimeout creates a new standard runner, but with a timeout.
Directories
¶
| Path | Synopsis |
|---|---|
|
examples
|
|
|
append
command
|
|
|
awk
command
|
|
|
buffer
command
|
|
|
envvar
command
$ X=Hello go run examples/envvar/main.go 2015/07/01 10:24:03 echo "$X" Hello
|
$ X=Hello go run examples/envvar/main.go 2015/07/01 10:24:03 echo "$X" Hello |
|
pipe
command
|
|
|
simple
command
|
|
|
timeout
command
|
|
|
withoutput
command
|
Click to show internal directories.
Click to hide internal directories.
