options

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2025 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoHosts indicates that no hosts have been set up.
	ErrNoHosts = errors.New("no hosts configured")
)

Functions

func Initialize

func Initialize(opts *Opts) error

Initialize ensures that outside dependencies needed on every execution of saturn-bot are set up. Such dependencies can be logging or directories.

Types

type ActionFactories

type ActionFactories []action.Factory

func (ActionFactories) Find

func (af ActionFactories) Find(name string) action.Factory

type FilterFactories

type FilterFactories []filter.Factory

func (FilterFactories) Find

func (ff FilterFactories) Find(name string) filter.Factory

type Opts

type Opts struct {
	ActionFactories ActionFactories
	// Clock interfaces to a clock.
	// Its purpose is to fake time in unit tests.
	// Defaults to an object that proxies to the [time] package.
	Clock                clock.Clock
	Config               config.Configuration
	FilterFactories      FilterFactories
	Hosts                []host.Host
	IsCi                 bool
	SkipPlugins          bool
	PushGateway          *push.Pusher
	PrometheusGatherer   prometheus.Gatherer
	PrometheusRegisterer prometheus.Registerer
	// contains filtered or unexported fields
}

func ToOptions

func ToOptions(c config.Configuration) (Opts, error)

ToOptions takes a configuration struct, initializes global state and returns an Options struct that can be modified further, if needed.

func (Opts) DataDir added in v0.8.0

func (o Opts) DataDir() string

func (*Opts) RepositoryCacheTtl added in v0.18.0

func (o *Opts) RepositoryCacheTtl() time.Duration

func (*Opts) SetPrometheusRegistry added in v0.16.0

func (o *Opts) SetPrometheusRegistry(reg *prometheus.Registry)

func (Opts) WorkerLoopInterval added in v0.8.0

func (o Opts) WorkerLoopInterval() time.Duration

Jump to

Keyboard shortcuts

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