Documentation ¶
Index ¶
Constants ¶
View Source
const ( LogMessageHeaderLength = 17 LogMessageStreamOffset = 4 LogMessageTimestampOffset = 5 LogMessageDataSizeOffset = 13 )
View Source
const (
DefaultBufferChannelLen = 4096
)
View Source
const (
DefaultFilePerms = 0755
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LogManager ¶
type LogManager struct {
// contains filtered or unexported fields
}
func NewLogManager ¶
func NewLogManager(ctx context.Context, executionID string) (*LogManager, error)
func (*LogManager) Close ¶
func (lm *LogManager) Close()
func (*LogManager) Drain ¶
func (lm *LogManager) Drain()
func (*LogManager) GetDefaultReaders ¶
func (*LogManager) GetMuxedReader ¶
func (lm *LogManager) GetMuxedReader(follow bool) io.ReadCloser
func (*LogManager) GetWriters ¶
func (lm *LogManager) GetWriters() (io.WriteCloser, io.WriteCloser)
type LogMessage ¶
type LogMessage struct { Stream LogStreamType `json:"s"` Data []byte `json:"d"` Timestamp int64 `json:"t"` }
func (*LogMessage) FromReader ¶
func (m *LogMessage) FromReader(reader bufio.Reader) error
func (*LogMessage) ToBytes ¶
func (m *LogMessage) ToBytes() []byte
ToBytes will convert the current LogMessage into a byte array which can be written to disk and reconstituted by FromBytes.
The first 4 bytes are the size of the entire LogMessage The next byte is O for stdout, E for stderr. The next 8bytes are the timestamp The next 4 bytes (n) are the size of the data Then the remaining n bytes are the data
type LogMessageTransformer ¶
type LogMessageTransformer func(*LogMessage) []byte
type LogReader ¶
type LogReader struct {
// contains filtered or unexported fields
}
func NewLogReader ¶
func NewLogReader(options LogReaderOptions) *LogReader
type LogReaderOptions ¶
type LogReaderOptions struct {
// contains filtered or unexported fields
}
type LogStreamType ¶
type LogStreamType int8
const ( LogStreamStdout LogStreamType = 1 LogStreamStderr LogStreamType = 2 )
type LogWriter ¶
type LogWriter struct {
// contains filtered or unexported fields
}
func NewLogWriter ¶
func NewLogWriter( buffer *generic.RingBuffer[*LogMessage], transformer LogWriterTransform, ) *LogWriter
type LogWriterTransform ¶
type LogWriterTransform func([]byte) *LogMessage
Click to show internal directories.
Click to hide internal directories.