restore

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: May 11, 2026 License: MIT Imports: 10 Imported by: 1 module, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	DelayFieldName = "runner.middleware.restore.delay"

	DelayDefault = 100 * time.Millisecond
)

Variables

View Source
var (
	ComponentNoRegistration = &component.Component{
		Name: "runner.middleware.restore.no_registration",
		Dependencies: component.Components{
			runner.Component,
		},
		Init: component.StepFunc(func(container container.Container) error {
			return container.Provides(NewConfig, NewRestore)
		}),
		BindFlags: component.BindFlags(func(flagSet flag.FlagSet, container container.Container) error {
			return container.Invoke(func(config *Config) {
				flagSet.DurationVar(&config.Delay, DelayFieldName, DelayDefault, "")
			})
		}),
		Configuration: component.StepFunc(func(container container.Container) error {
			return container.Invoke(Configuration)
		}),
	}

	Component = &component.Component{
		Name: "runner.middleware.restore",
		Dependencies: component.Components{
			runner.Component,
		},
		Init: component.StepFunc(func(container container.Container) error {
			return container.Provides(NewConfig, NewRestore)
		}),
		BindFlags: component.BindFlags(func(flagSet flag.FlagSet, container container.Container) error {
			return container.Invoke(func(config *Config) {
				flagSet.DurationVar(&config.Delay, DelayFieldName, DelayDefault, "")
			})
		}),
		Configuration: component.StepFunc(func(container container.Container) error {
			if err := container.Invoke(Configuration); err != nil {
				return err
			}

			return container.Invoke(func(r runner.Runner, middleware *Restore) {
				r.Use(middleware)
			})
		}),
	}
)

Functions

This section is empty.

Types

type Config

type Config struct {
	Delay time.Duration
}

func Configuration

func Configuration(config *Config, configurator configurator.Configurator) *Config

func NewConfig

func NewConfig() *Config

type Restore

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

func NewRestore

func NewRestore(config *Config, runner runner.Runner, logger logger.Logger) *Restore

func (*Restore) Middleware

func (restore *Restore) Middleware(process runner.Process, next runner.ProcessFunc) runner.ProcessFunc

Jump to

Keyboard shortcuts

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