reminder

package
v0.0.70 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package reminder contains configuration options for the reminder service.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterReminderFlags

func RegisterReminderFlags(v *viper.Viper, flags *pflag.FlagSet) error

RegisterReminderFlags registers the flags for the minder cli

func SetViperDefaults

func SetViperDefaults(v *viper.Viper)

SetViperDefaults sets the default values for the configuration to be picked up by viper

Types

type Config

type Config struct {
	Database         config.DatabaseConfig `mapstructure:"database"`
	RecurrenceConfig RecurrenceConfig      `mapstructure:"recurrence"`
	EventConfig      EventConfig           `mapstructure:"events"`
	LoggingConfig    LoggingConfig         `mapstructure:"logging"`
}

Config contains the configuration for the reminder service

func (Config) Validate

func (c Config) Validate() error

Validate validates the configuration

type EventConfig

type EventConfig struct {
	// Connection is the configuration for the SQL event driver
	//
	// nolint: lll
	Connection config.DatabaseConfig `mapstructure:"sql_connection" default:"{\"dbname\":\"reminder\",\"dbhost\":\"reminder-event-postgres\"}"`
}

EventConfig is the configuration for reminder's eventing system.

type LoggingConfig

type LoggingConfig struct {
	Level string `mapstructure:"level" default:"info"`
}

LoggingConfig is the configuration for the logger

type RecurrenceConfig

type RecurrenceConfig struct {
	// Interval is the time between reminders
	Interval time.Duration `mapstructure:"interval" default:"1h"`
	// BatchSize is the number of reminders to process at once. Batch size cannot be less than
	// MaxPerProject * MinProjectFetchLimit.
	BatchSize int `mapstructure:"batch_size" default:"100"`
	// MinElapsed is the minimum time after last update before sending a reminder
	MinElapsed time.Duration `mapstructure:"min_elapsed" default:"1h"`
}

RecurrenceConfig contains the configuration for the reminder recurrence

func (RecurrenceConfig) Validate

func (r RecurrenceConfig) Validate() error

Validate checks that the recurrence config is valid

Jump to

Keyboard shortcuts

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