2020-08-11 04:38:42 +00:00
|
|
|
package docker
|
|
|
|
|
|
|
|
import "io"
|
|
|
|
|
|
|
|
type Console struct {
|
|
|
|
HandlerFunc *func(string)
|
|
|
|
}
|
|
|
|
|
|
|
|
var _ io.Writer = Console{}
|
|
|
|
|
|
|
|
func (c Console) Write(b []byte) (int, error) {
|
|
|
|
if c.HandlerFunc != nil {
|
|
|
|
l := make([]byte, len(b))
|
|
|
|
copy(l, b)
|
|
|
|
|
|
|
|
(*c.HandlerFunc)(string(l))
|
|
|
|
}
|
|
|
|
|
|
|
|
return len(b), nil
|
2020-09-05 19:08:40 +00:00
|
|
|
}
|