retention

package
v2.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package retention provides the retention policy enforcement service.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrometheusCollectors added in v2.2.0

func PrometheusCollectors() []prometheus.Collector

Types

type Config

type Config struct {
	Enabled       bool          `toml:"enabled"`
	CheckInterval toml.Duration `toml:"check-interval"`
}

Config represents the configuration for the retention service.

func NewConfig

func NewConfig() Config

NewConfig returns an instance of Config with defaults.

func (Config) Validate

func (c Config) Validate() error

Validate returns an error if the Config is invalid.

type Service

type Service struct {
	MetaClient interface {
		Databases() []meta.DatabaseInfo
		DeleteShardGroup(database, policy string, id uint64) error
		PruneShardGroups() error
	}
	TSDBStore interface {
		ShardIDs() []uint64
		DeleteShard(shardID uint64) error
	}
	// contains filtered or unexported fields
}

Service represents the retention policy enforcement service.

func NewService

func NewService(c Config) *Service

NewService returns a configured retention policy enforcement service.

func (*Service) Close

func (s *Service) Close() error

Close stops retention policy enforcement.

func (*Service) Open

func (s *Service) Open(ctx context.Context) error

Open starts retention policy enforcement.

func (*Service) WithLogger

func (s *Service) WithLogger(log *zap.Logger)

WithLogger sets the logger on the service.

Jump to

Keyboard shortcuts

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