repodiag

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: Apache-2.0 Imports: 16 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 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 *Writer) *LogManager

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

func (*LogManager) Enable

func (m *LogManager) Enable()

Enable enables writing any buffered logs to repository.

func (*LogManager) NewLogger

func (m *LogManager) NewLogger() *zap.SugaredLogger

NewLogger creates new logger.

type Writer

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

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

func NewWriter

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

NewWriter creates a new writer.

func (*Writer) EncryptAndWriteBlobAsync

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

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

func (*Writer) Wait

func (w *Writer) Wait(ctx context.Context) error

Wait waits for all the writes to complete.

Jump to

Keyboard shortcuts

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