logs

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: MPL-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package logs handles log output from a run

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*otfapi.Client
}

func (*Client) PutChunk

func (c *Client) PutChunk(ctx context.Context, opts internal.PutChunkOptions) error

type Options

type Options struct {
	logr.Logger
	internal.Cache
	*sql.DB
	*sql.Listener
	internal.Verifier

	RunAuthorizer internal.Authorizer
}

type PhaseWriter

type PhaseWriter struct {
	internal.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

func (*PhaseWriter) Write

func (w *PhaseWriter) Write(p []byte) (int, error)

Write uploads a chunk of logs to the server.

type PhaseWriterOptions

type PhaseWriterOptions struct {
	RunID  string
	Phase  internal.PhaseType
	Writer internal.PutChunkService
}

type Service

type Service struct {
	logr.Logger
	// contains filtered or unexported fields
}

func NewService

func NewService(opts Options) *Service

func (*Service) AddHandlers

func (s *Service) AddHandlers(r *mux.Router)

func (*Service) GetChunk

func (s *Service) GetChunk(ctx context.Context, opts internal.GetChunkOptions) (internal.Chunk, error)

GetChunk reads a chunk of logs for a phase.

NOTE: unauthenticated - access granted only via signed URL

func (*Service) PutChunk

func (s *Service) PutChunk(ctx context.Context, opts internal.PutChunkOptions) error

PutChunk writes a chunk of logs for a phase

func (*Service) Tail

func (s *Service) Tail(ctx context.Context, opts internal.GetChunkOptions) (<-chan internal.Chunk, error)

Tail logs for a phase. Offset specifies the number of bytes into the logs from which to start tailing.

func (*Service) WatchLogs

func (s *Service) WatchLogs(ctx context.Context) (<-chan pubsub.Event[internal.Chunk], func())

Jump to

Keyboard shortcuts

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