Documentation
¶
Overview ¶
Package logs handles log output from a run
Index ¶
Constants ¶
View Source
const ( STX = 0x02 // marks the beginning of logs for a phase ETX = 0x03 // marks the end of logs for a phase )
View Source
const ( EventLogChunk string = "log_update" EventLogFinished string = "log_finished" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Chunk ¶ added in v0.3.6
type Chunk struct {
// TODO: this is better set as a monotonic serial rather than a TFE ID.
ID resource.TfeID `json:"chunk_id"` // Uniquely identifies the chunk.
RunID resource.TfeID `json:"run_id"` // ID of run that generated the chunk
Phase internal.PhaseType `json:"phase"` // Phase that generated the chunk
Offset int `json:"_offset"` // Position within logs.
Data PostgresHex `json:"chunk"` // The log data
}
Chunk is a section of logs for a phase.
func (Chunk) Cut ¶ added in v0.3.6
func (c Chunk) Cut(opts GetChunkOptions) Chunk
Cut returns a new, smaller chunk.
func (Chunk) NextOffset ¶ added in v0.3.6
NextOffset returns the offset for the next chunk
type GetChunkOptions ¶ added in v0.3.6
type PhaseWriter ¶
type PhaseWriter struct {
PutChunkService // for uploading logs to server
// contains filtered or unexported fields
}
PhaseWriter writes logs on behalf of a run phase.
func NewPhaseWriter ¶
func NewPhaseWriter(ctx context.Context, opts PhaseWriterOptions) *PhaseWriter
func (*PhaseWriter) Close ¶
func (w *PhaseWriter) Close() error
Close must be called to complete writing job logs
type PhaseWriterOptions ¶
type PhaseWriterOptions struct {
RunID resource.TfeID
Phase internal.PhaseType
Writer PutChunkService
}
type PostgresHex ¶ added in v0.3.23
type PostgresHex []byte
PostgresHex is a hex encoded byte array originating from Postgres.
func (*PostgresHex) UnmarshalJSON ¶ added in v0.3.23
func (h *PostgresHex) UnmarshalJSON(data []byte) error
UnmarshalJSON unmarshals the overly escaped hex encoded byte array.
type PutChunkOptions ¶ added in v0.3.6
type PutChunkService ¶ added in v0.3.6
type PutChunkService interface {
PutChunk(ctx context.Context, opts PutChunkOptions) error
}
type Service ¶
type Service struct {
logr.Logger
*authz.Authorizer
// contains filtered or unexported fields
}
func NewService ¶
func (*Service) AddHandlers ¶ added in v0.2.2
Click to show internal directories.
Click to hide internal directories.