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 ¶
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.
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.
Click to show internal directories.
Click to hide internal directories.