add a File struct

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2019-06-15 14:45:09 -07:00
parent 460baa0559
commit a3042062d8
1 changed files with 31 additions and 0 deletions

31
structs.go Normal file
View File

@ -0,0 +1,31 @@
package shell
import "io"
import "bufio"
import "bytes"
import "github.com/svent/go-nbreader"
var FileMap map[string]*File
var readBufferSize int
type File struct {
Name string
BufferSize int
FbytesBuffer bytes.Buffer
Fbytes []byte
Fio io.ReadCloser // := process.StdoutPipe()
Fbufio *bufio.Reader // := bufio.NewReader(pOUT)
Fnbreader *nbreader.NBReader // := nbreader.NewNBReader(readOUT, 1024)
}
func FileCreate(f io.ReadCloser) *File {
var newfile File
newfile.Fio = f
newfile.Fbufio = bufio.NewReader(f)
newfile.Fnbreader = nbreader.NewNBReader(newfile.Fbufio, 1024)
return &newfile
}