logs

package
v0.1.18 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2023 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

func NewService

func NewService(opts Options) *service

Types

type Client

type Client struct {
	*otfapi.Client
}

func (*Client) PutChunk

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

type LogsService

type LogsService = Service

type Options

type Options struct {
	logr.Logger
	internal.Cache
	*sql.DB
	*pubsub.Broker
	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 interface {
	GetChunk(ctx context.Context, opts internal.GetChunkOptions) (internal.Chunk, error)
	Tail(ctx context.Context, opts internal.GetChunkOptions) (<-chan internal.Chunk, error)
	internal.PutChunkService
	Start(context.Context) error
}

Jump to

Keyboard shortcuts

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