reminder

package
v0.0.85 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2025 License: Apache-2.0 Imports: 11 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 LoggerFromConfigFlags

func LoggerFromConfigFlags(cfg LoggingConfig) zerolog.Logger

LoggerFromConfigFlags creates a new logger from the provided configuration

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      serverconfig.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 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