poll

package
v0.89.2 Latest Latest
Warning

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

Go to latest
Published: May 30, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const MinPollInterval = 10 * time.Second // Minimum allowed poll interval

Variables

View Source
var (
	ErrInvalidConfig  = errors.New("invalid poll configuration")
	ErrBothConfigSet  = errors.New("both POLL_CONFIG and POLL_CONFIG_FILE are set, please use one or the other")
	ErrIntervalTooLow = errors.New("poll interval too low")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	Source       config.SourceType `yaml:"source" json:"source" default:"git"`          // Source selects the poll source backend (git or oci)
	SourceUrl    string            `yaml:"url" json:"url"`                              // SourceUrl is the repository/artifact URL; validated as GitUrl or OciUrl depending on Source
	Reference    string            `yaml:"reference" json:"reference"`                  // Reference is the Git reference to the deployment, e.g., refs/heads/main, main, refs/tags/v1.0.0 or v1.0.0
	Interval     time.Duration     `yaml:"interval" default:"180s"`                     // Interval is the interval at which to poll for changes
	CustomTarget string            `yaml:"target" json:"target" default:""`             // CustomTarget is the name of an optional custom deployment config file, e.g. ".doco-cd.custom-name.yaml"
	RunOnce      bool              `yaml:"run_once" default:"false"`                    // RunOnce when true, performs a single run and exits
	Deployments  []*deploy.Config  `yaml:"deployments" json:"deployments" default:"[]"` // Deployments allows defining deployment configs inline in the poll configuration
}

func (*Config) LogValue

func (c *Config) LogValue() slog.Value

LogValue implements the slog.LogValuer interface for Config.

func (*Config) String

func (c *Config) String() string

String returns a string representation of the Config.

func (*Config) UnmarshalJSON

func (c *Config) UnmarshalJSON(data []byte) error

func (*Config) UnmarshalYAML

func (c *Config) UnmarshalYAML(unmarshal func(any) error) error

func (*Config) Validate

func (c *Config) Validate() error

Validate checks if the Config is valid.

type Job

type Job struct {
	Config  Config // config is the Config for this instance
	LastRun int64  // LastRun is the last time this instance ran
	NextRun int64  // NextRun is the next time this instance should run
}

Jump to

Keyboard shortcuts

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