Documentation ¶
Overview ¶
Package logs handles log output from a run
Index ¶
- Constants
- type Chunk
- type Client
- type GetChunkOptions
- type Options
- type PhaseWriter
- type PhaseWriterOptions
- type PutChunkOptions
- type PutChunkService
- type Service
- func (s *Service) AddHandlers(r *mux.Router)
- func (s *Service) GetChunk(ctx context.Context, opts GetChunkOptions) (Chunk, error)
- func (s *Service) PutChunk(ctx context.Context, opts PutChunkOptions) error
- func (s *Service) Tail(ctx context.Context, opts GetChunkOptions) (<-chan Chunk, error)
- func (s *Service) WatchLogs(ctx context.Context) (<-chan pubsub.Event[Chunk], func())
Constants ¶
View Source
const ( STX = 0x02 // marks the beginning of logs for a phase ETX = 0x03 // marks the end of logs for a phase )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Chunk ¶ added in v0.3.6
type Chunk struct { resource.ID `json:"id"` // Uniquely identifies the chunk. RunID resource.ID `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 []byte `json:"data"` // 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.ID Phase internal.PhaseType Writer PutChunkService }
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 ¶
func NewService ¶
func (*Service) AddHandlers ¶ added in v0.2.2
func (*Service) GetChunk ¶
GetChunk reads a chunk of logs for a phase.
NOTE: unauthenticated - access granted only via signed URL
func (*Service) PutChunk ¶ added in v0.2.2
func (s *Service) PutChunk(ctx context.Context, opts PutChunkOptions) error
PutChunk writes a chunk of logs for a phase
Click to show internal directories.
Click to hide internal directories.