logs

package
v0.9.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 18, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

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 = 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

type HTTPSender interface {
	Send(*httpbody.HttpBody) error
}

HTTPSender is an interface that defines the contract for sending log data in HTTP body.

type LogSender added in v0.9.0

type LogSender interface {
	Send(*pb.Log) error
}

LogSender is an interface that defines the contract for sending log data.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL