logpersister

package
v0.50.1-rc0 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package logpersister provides a piped component that enqueues all log blocks from running stages and then periodically sends to the control plane.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPersister

func NewPersister(apiClient apiClient, logger *zap.Logger) *persister

NewPersister creates a new persister instance for saving the stage logs into server's storage. This controls how many concurent api calls should be executed and when to flush the logs.

Types

type Persister

type Persister interface {
	Run(ctx context.Context) error
	StageLogPersister(deploymentID, stageID string) StageLogPersister
}

Persister is responsible for saving the stage logs into server's storage. It sends the logs to the piped plugin-api grpc server through the apiClient.

type StageLogPersister

type StageLogPersister interface {
	Write(log []byte) (int, error)
	Info(log string)
	Infof(format string, a ...interface{})
	Success(log string)
	Successf(format string, a ...interface{})
	Error(log string)
	Errorf(format string, a ...interface{})
	Complete(timeout time.Duration) error
}

StageLogPersister is a child persister instance for a specific stage. Use this to persist the stage logs and make it viewable on the UI.

Jump to

Keyboard shortcuts

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