prune

package
v0.2.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PruneMessages

func PruneMessages(dataAccessor storage.DataAccessor, config config.MessagePruningConfig) error

PruneMessages prunes messages older than the configured retention period. It retrieves messages, their associated jobs, archives them, and then deletes them from the database. The archiving process is currently a placeholder and needs to be implemented. dataAccessor: Accessor for database operations. config: Configuration for message pruning. Returns an error if any operation fails.

Types

type ArchiveDirector

type ArchiveDirector struct {
	LocalArchiveManager  *ArchiveWriteManager
	RemoteArchiveManager *ArchiveWriteManager
}

func (*ArchiveDirector) Close

func (director *ArchiveDirector) Close()

type ArchiveWriteManager

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

ArchiveWriteManager handles file rotation for cloud storage.

func NewArchiveWriteManager

func NewArchiveWriteManager(bucket Bucket, objectName string, maxSize int64) (*ArchiveWriteManager, error)

NewArchiveWriteManager creates a new RotationManager.

func (*ArchiveWriteManager) Close

func (rm *ArchiveWriteManager) Close() error

Close closes the underlying writer.

func (*ArchiveWriteManager) Write

func (rm *ArchiveWriteManager) Write(ctx context.Context, jsonStr string) (int, error)

Write writes the given JSON string to the current object. It handles rotation if the maximum size is exceeded.

type Bucket

type Bucket interface {
	NewReader(ctx context.Context, key string, opts *blob.ReaderOptions) (Reader, error)
	NewWriter(ctx context.Context, key string, opts *blob.WriterOptions) (Writer, error)
	Copy(ctx context.Context, dstKey, srcKey string, opts *blob.CopyOptions) error
	Exists(ctx context.Context, key string) (bool, error)
}

Bucket defines the interface for cloud storage operations.

func NewBlobBucket

func NewBlobBucket(bucket *blob.Bucket) Bucket

NewBlobBucket creates a new Bucket using "gocloud.dev/blob".

type Reader

type Reader interface {
	io.ReadCloser
	Size() int64
}

Reader defines the interface for reading from cloud storage objects.

type Writer

type Writer interface {
	io.WriteCloser
}

Writer defines the interface for writing to cloud storage objects.

Jump to

Keyboard shortcuts

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