diff options
| author | Jeff Carr <[email protected]> | 2019-06-16 10:49:01 -0700 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2019-06-16 10:49:01 -0700 |
| commit | 30d3fe09b5e7d117a3db260a6700d95d19a48367 (patch) | |
| tree | 61114829d1c81acb03c7001a1029cf7f2d4a8593 /structs.go | |
| parent | 3fadcf18a67fe6bc8e5037be4702a0781c5cad47 (diff) | |
smarter go syntax for Run()
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'structs.go')
| -rw-r--r-- | structs.go | 41 |
1 files changed, 41 insertions, 0 deletions
@@ -1,6 +1,7 @@ package shell import "io" +import "os/exec" import "bufio" import "bytes" import "github.com/svent/go-nbreader" @@ -9,6 +10,7 @@ var FileMap map[string]*File var readBufferSize int +/* type File struct { Name string BufferSize int @@ -22,7 +24,45 @@ type File struct { Fbufio *bufio.Reader // := bufio.NewReader(pOUT) Fnbreader *nbreader.NBReader // := nbreader.NewNBReader(readOUT, 1024) } +*/ +type File struct { + Name string + // BufferSize int + // Buffer *bytes.Buffer + // Fbytes []byte + TotalCount int + Empty bool + Dead bool + + Fio io.ReadCloser // := process.StdoutPipe() + Fbufio *bufio.Reader // := bufio.NewReader(pOUT) + Fnbreader *nbreader.NBReader // := nbreader.NewNBReader(readOUT, 1024) +} + +type Shell struct { + Cmdline string + Process *exec.Cmd + Done bool + Quiet bool + Error error + Buffer *bytes.Buffer + + // which names are really better here? + // for now I init them both to test out + // how the code looks and feels + STDOUT *File + STDERR *File + Stdout *File + Stderr *File +} + +func New() *Shell { + var tmp Shell + return &tmp +} + +/* func FileCreate(f io.ReadCloser) *File { var newfile File @@ -32,3 +72,4 @@ func FileCreate(f io.ReadCloser) *File { return &newfile } +*/ |
