Documentation ¶
Index ¶
- type Chunk
- type ChunkType
- type Error
- type OutputWriter
- func (ow *OutputWriter) BinaryWriter() io.Writer
- func (ow *OutputWriter) Flush()
- func (ow *OutputWriter) InfoWriter() io.Writer
- func (ow *OutputWriter) StdoutWriter() io.Writer
- func (ow *OutputWriter) With(args ...interface{}) *OutputWriter
- func (ow *OutputWriter) WriteBinary(b []byte) (n int, err error)
- func (ow *OutputWriter) WriteError(message string, keysAndValues ...interface{})
- func (ow *OutputWriter) WriteProgress(b []byte) (n int, err error)
- func (ow *OutputWriter) WriteResult(res interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Chunk ¶
type Chunk struct { Type ChunkType `json:"t"` // progress or result or error Payload interface{} `json:"p,omitempty"` Error *Error `json:"e,omitempty"` }
Chunk is a response chunk sent from the Testground daemon to the Testground client. For a given request, clients should expect between 0 to `n` `progress` chunks, and exactly 1 `result` or `error` chunk before EOF.
type OutputWriter ¶
type OutputWriter struct { sync.Mutex *zap.SugaredLogger // contains filtered or unexported fields }
func Discard ¶
func Discard() *OutputWriter
func NewFileOutputWriter ¶ added in v0.6.0
func NewFileOutputWriter(w io.Writer) *OutputWriter
func NewOutputWriter ¶
func NewOutputWriter(w http.ResponseWriter, r *http.Request) *OutputWriter
func NewStdoutWriter ¶ added in v0.6.0
func NewStdoutWriter() *OutputWriter
func (*OutputWriter) BinaryWriter ¶
func (ow *OutputWriter) BinaryWriter() io.Writer
func (*OutputWriter) Flush ¶
func (ow *OutputWriter) Flush()
func (*OutputWriter) InfoWriter ¶
func (ow *OutputWriter) InfoWriter() io.Writer
InfoWriter returns an io.Writer that turns all writes into Info log statements in the underlying logger.
func (*OutputWriter) StdoutWriter ¶
func (ow *OutputWriter) StdoutWriter() io.Writer
StdoutWriter returns an io.Writer that prints all writes into Stdout, and sends them to the client as a progress chunk.
func (*OutputWriter) With ¶
func (ow *OutputWriter) With(args ...interface{}) *OutputWriter
With returns a new OutputWriter, replacing the SugaredLogger with the result from delegating to SugaredLogger.With.
func (*OutputWriter) WriteBinary ¶
func (ow *OutputWriter) WriteBinary(b []byte) (n int, err error)
func (*OutputWriter) WriteError ¶
func (ow *OutputWriter) WriteError(message string, keysAndValues ...interface{})
func (*OutputWriter) WriteProgress ¶
func (ow *OutputWriter) WriteProgress(b []byte) (n int, err error)
func (*OutputWriter) WriteResult ¶
func (ow *OutputWriter) WriteResult(res interface{})
Click to show internal directories.
Click to hide internal directories.