juju: github.com/wallyworld/juju/worker/pruner Index | Files

package pruner

import "github.com/wallyworld/juju/worker/pruner"


Package Files

config.go manifold.go worker.go

func Manifold Uses

func Manifold(config ManifoldConfig) dependency.Manifold

Manifold returns a Manifold that encapsulates the statushistorypruner worker.

type Config Uses

type Config struct {
    Facade        Facade
    PruneInterval time.Duration
    Clock         clock.Clock
    Logger        Logger

Config holds all necessary attributes to start a pruner worker.

func (*Config) Validate Uses

func (c *Config) Validate() error

Validate will err unless basic requirements for a valid config are met.

type Facade Uses

type Facade interface {
    Prune(time.Duration, int) error
    WatchForModelConfigChanges() (watcher.NotifyWatcher, error)
    ModelConfig() (*config.Config, error)

Facade represents an API that implements status history pruning.

type Logger Uses

type Logger interface {
    Infof(string, ...interface{})

Logger defines the methods used by the pruner worker for logging.

type ManifoldConfig Uses

type ManifoldConfig struct {
    APICallerName string
    Clock         clock.Clock
    PruneInterval time.Duration
    NewWorker     func(Config) (worker.Worker, error)
    NewFacade     func(base.APICaller) Facade
    Logger        Logger

ManifoldConfig describes the resources and configuration on which the statushistorypruner worker depends.

func (ManifoldConfig) Validate Uses

func (config ManifoldConfig) Validate() error

Validate is called by start to check for bad configuration.

type PrunerWorker Uses

type PrunerWorker struct {
    // contains filtered or unexported fields

PrunerWorker prunes status history or action records at regular intervals.

func New Uses

func New(conf Config) PrunerWorker

New returns a worker.Worker for history Pruner.

func (*PrunerWorker) Catacomb Uses

func (w *PrunerWorker) Catacomb() *catacomb.Catacomb

Catacomb returns the prune worker's catacomb.

func (*PrunerWorker) Config Uses

func (w *PrunerWorker) Config() *Config

Config return the prune worker's config.

func (*PrunerWorker) Kill Uses

func (w *PrunerWorker) Kill()

Kill is defined on worker.Worker.

func (*PrunerWorker) Wait Uses

func (w *PrunerWorker) Wait() error

Wait is defined on worker.Worker.

func (*PrunerWorker) Work Uses

func (w *PrunerWorker) Work(getPrunerConfig func(*config.Config) (time.Duration, uint)) error

Work is the main body of generic pruner loop.

Package pruner imports 9 packages (graph). Updated 2020-08-06. Refresh now. Tools for package owners.