runtime

package
v0.22.3 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2022 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	DingConfig          *notify.DingConfig     `json:"ding_config" validate:"omitempty"`
	MailConfig          *notify.MailConfig     `json:"mail_config" validate:"omitempty"`
	TelegramConfig      *notify.TelegramConfig `json:"telegram_config" validate:"omitempty"`
	KvStore             string                 `json:"kv_store" validate:"required,oneof=mem file fauna pg"`
	FileStoreConfigPath string                 `json:"file_store_config_path" validate:"omitempty"`
	WatcherConfigs      []WatcherConfig        `json:"watcher_configs" validate:"gt=0,dive"`
	FaunaConfig         *fauna.Config          `json:"fauna_config"`
	FileConfig          *file.Config           `json:"file_config"`
	PgConfig            *pg.Config             `json:"pg_config"`
}

type Option

type Option func(o *runtimeOpts)

Option is a function that customizes the runtime.

func WithConfigFile

func WithConfigFile(path string) Option

func WithLimitInterval

func WithLimitInterval(limitInterval time.Duration) Option

func WithNotifiers

func WithNotifiers(notifiers ...notify.Component) Option

func WithSerialize

func WithSerialize(serialize bool) Option

func WithSingle

func WithSingle(single bool) Option

func WithStores

func WithStores(stores ...store.Component) Option

type RssWatcherRuntime

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

func NewRssWatcherRuntime

func NewRssWatcherRuntime(logger *logger.Logger) *RssWatcherRuntime

func (*RssWatcherRuntime) Run

func (r *RssWatcherRuntime) Run(opts ...Option) error

type WatcherConfig

type WatcherConfig struct {
	Source    string    `json:"source" validate:"required"`
	Interval  *duration `json:"interval" validate:"required"`
	Notifiers []string  `json:"notifiers" validate:"gt=0,dive,oneof=ding mail tg printer"`
	Skip      int       `json:"skip" validate:"omitempty,gte=0"`
}

Jump to

Keyboard shortcuts

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