Documentation ¶
Overview ¶
Package repodiag manages logs and metrics in the repository.
Index ¶
Constants ¶
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, folllowed by calling the provided closeFunc.
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) *LogManager
NewLogManager creates a new LogManager that will emit logs as repository blobs.
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() *zap.SugaredLogger
NewLogger creates new logger.