Documentation ¶
Overview ¶
bash package implements simple bash commands that are sometimes useful when writing go scripts
Index ¶
- func BytesToBuffer(reader *GunzipReader) *bytes.Buffer
- func Cut(line string, d byte, f ...int) []string
- func DirectorySetUp(dir string, golang string) *api.Bash
- func GetColumnCount(line string, delim byte) int
- func LatestGoResource() *api.Bash
- func Mkdir(path string, perm os.FileMode)
- func NewPzip(filename string, data []string)
- func ReadLine(reader *GunzipReader) (*bytes.Buffer, bool)
- type Cmd
- type GunzipReader
- type GzipWriter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BytesToBuffer ¶
func BytesToBuffer(reader *GunzipReader) *bytes.Buffer
BytesToBuffer will parse []byte and return a pointer to the same underlying bytes.Buffer
func Cut ¶
Cut mimics the basic bash command to cut a column by any delim and returns the fields indices you specify indices start at 0
func GetColumnCount ¶
func LatestGoResource ¶
Types ¶
type Cmd ¶
func (*Cmd) StdinChannel ¶
StdinChannel returns a channel that will be connected to the command's standard error when the command starts.
type GunzipReader ¶
type GunzipReader struct { *bufio.Reader Unzip io.Reader Cmd *exec.Cmd Buffer *bytes.Buffer // contains filtered or unexported fields }
GunzipReader uncompress the input using the system's gzip. Apparently, the system gzip is much much faster than the go library, so I wrote some bench marks and tests
func NewGunzipReader ¶
func NewGunzipReader(filename string) *GunzipReader
func (GunzipReader) Close ¶
func (gz GunzipReader) Close()
Click to show internal directories.
Click to hide internal directories.