Documentation
¶
Index ¶
Constants ¶
View Source
const (
// DefaultBufferSize is the default buffer size. This based on the recommended
// gRPC message size for streamed content, which ranges from 16 to 64 KiB. Choosing 32 KiB as a
// middle ground between the two.
DefaultBufferSize = 32 * 1024
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BufferedLog ¶
type BufferedLog struct {
// contains filtered or unexported fields
}
BufferedLog is in memory buffered log sender.
func NewBufferedWriter ¶
func NewBufferedWriter(sender Sender, name string, size int) *BufferedLog
NewBufferedWriter returns an io.Writer that writes log chunk messages to the gRPC sender for the named Tekton result. The chunk size determines the maximum size of a single sent message - if less than zero, this defaults to DefaultBufferSize.
func (*BufferedLog) Flush ¶
func (w *BufferedLog) Flush() (int, error)
Flush sends all remaining bytes in the buffer to consumer.
func (*BufferedLog) Write ¶
func (w *BufferedLog) Write(p []byte) (n int, err error)
Write sends bytes to the buffer and/or consumer (e.g., gRPC stream). This method combines the bytes from the buffer with a new portion of p bytes in memory. Bytes larger than the buffer size will be truncated and sent to the consumer, while the remaining bytes will be stored in the buffer.
Click to show internal directories.
Click to hide internal directories.