repodiag

package
v0.22.2 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package repodiag manages logs and metrics in the repository.

Index

Constants

View Source
const LogBlobPrefix = "_log_"

LogBlobPrefix is a prefix given to text logs stored in repository.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlobWriter added in v0.18.0

type BlobWriter struct {
	// contains filtered or unexported fields
}

BlobWriter manages encryption and asynchronous writing of diagnostic blobs to the repository.

func NewWriter

func NewWriter(
	st blob.Storage,
	bc blobcrypto.Crypter,
) *BlobWriter

NewWriter creates a new writer.

func (*BlobWriter) EncryptAndWriteBlobAsync added in v0.18.0

func (w *BlobWriter) EncryptAndWriteBlobAsync(ctx context.Context, prefix blob.ID, data gather.Bytes, closeFunc func())

EncryptAndWriteBlobAsync encrypts given content and writes it to the repository asynchronously, followed by calling the provided closeFunc.

func (*BlobWriter) Wait added in v0.18.0

func (w *BlobWriter) Wait(_ context.Context) error

Wait waits for all the writes to complete.

type LogManager

type LogManager struct {
	// contains filtered or unexported fields
}

LogManager manages writing encrypted log blobs to the repository.

func NewLogManager

func NewLogManager(ctx context.Context, w *BlobWriter, disableRepositoryLog bool, textWriter io.Writer, params ...contentlog.ParamWriter) *LogManager

NewLogManager creates a new LogManager that will emit logs as repository blobs.

func (*LogManager) Disable added in v0.22.0

func (m *LogManager) Disable()

Disable disables writing log blobs to repository.

func (*LogManager) Enable

func (m *LogManager) Enable()

Enable enables writing log blobs to repository. Logs are not written to the repository until Enable is called.

func (*LogManager) NewLogger

func (m *LogManager) NewLogger(name string) *contentlog.Logger

NewLogger creates new logger.

func (*LogManager) Sync added in v0.22.0

func (m *LogManager) Sync()

Sync flushes the current buffer to the repository.

Jump to

Keyboard shortcuts

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