Documentation
¶
Index ¶
Constants ¶
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 = 64 * 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 NewBufferedHTTPWriter ¶ added in v0.9.0
func NewBufferedHTTPWriter(sender HTTPSender, name string, size int) *BufferedLog
NewBufferedHTTPWriter 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 NewBufferedWriter ¶
func NewBufferedWriter(sender LogSender, 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.
type HTTPSender ¶ added in v0.9.0
HTTPSender is an interface that defines the contract for sending log data in HTTP body.