logretention

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Apply

func Apply(ctx context.Context, redisClient redis.Cmdable, chConn clickhouse.DB, deploymentID string, desiredTTLDays int, logger *logging.Logger) error

Apply compares the desired TTL with the persisted TTL. If they differ, it applies the TTL to ClickHouse and persists the new value to Redis.

Types

type ClickHouseExecer

type ClickHouseExecer interface {
	Exec(ctx context.Context, query string, args ...any) error
}

ClickHouseExecer is a minimal interface for ClickHouse operations needed by ClickHouseTTL.

type ClickHouseTTL

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

ClickHouseTTL implements LogStoreTTL for ClickHouse.

func NewClickHouseTTL

func NewClickHouseTTL(conn clickhouse.DB, deploymentID string) *ClickHouseTTL

NewClickHouseTTL creates a new ClickHouse TTL applier.

func (*ClickHouseTTL) ApplyTTL

func (c *ClickHouseTTL) ApplyTTL(ctx context.Context, ttlDays int) error

ApplyTTL modifies the TTL on ClickHouse tables. If ttlDays is 0, the TTL is removed.

type RedisPolicyStore

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

RedisPolicyStore implements PolicyStore using Redis.

func NewRedisPolicyStore

func NewRedisPolicyStore(client redis.Cmdable, deploymentID string) *RedisPolicyStore

NewRedisPolicyStore creates a new Redis-backed policy store.

func (*RedisPolicyStore) GetAppliedTTL

func (s *RedisPolicyStore) GetAppliedTTL(ctx context.Context) (int, error)

GetAppliedTTL reads the persisted TTL value from Redis. Returns -1 if the key doesn't exist.

func (*RedisPolicyStore) SetAppliedTTL

func (s *RedisPolicyStore) SetAppliedTTL(ctx context.Context, ttlDays int) error

SetAppliedTTL writes the TTL value to Redis.

Jump to

Keyboard shortcuts

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