canvas.go (459B)
1 package canvas 2 3 import ( 4 "bytes" 5 "os" 6 "sync" 7 8 "code.dwrz.net/src/pkg/log" 9 "code.dwrz.net/src/pkg/terminal" 10 ) 11 12 type Canvas struct { 13 log *log.Logger 14 out *os.File 15 terminal *terminal.Terminal 16 17 mu sync.Mutex 18 buf bytes.Buffer 19 } 20 21 type Parameters struct { 22 Log *log.Logger 23 Out *os.File 24 Terminal *terminal.Terminal 25 } 26 27 func New(p Parameters) *Canvas { 28 return &Canvas{ 29 log: p.Log, 30 out: p.Out, 31 terminal: p.Terminal, 32 } 33 }