config

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitConfig

func InitConfig(cfgFile string)

Types

type Config

type Config struct {
	RedditSecret   string
	RedditID       string
	RedditUsername string

	Subreddits []Subreddits
}

func Parse

func Parse() (*Config, error)

func (*Config) SubredditNameList

func (c *Config) SubredditNameList() []string

type Raw

type Raw struct {
	RedditSecret   string `mapstructure:"reddit_secret"`
	RedditID       string `mapstructure:"reddit_id"`
	RedditUsername string `mapstructure:"reddit_username"`

	NotifyTitleTemplate   string   `mapstructure:"notify_title_template"`
	NotifyMessageTemplate string   `mapstructure:"notify_message_template"`
	Notify                []string `mapstructure:"notify"`

	Subreddits []RawSubreddits `mapstructure:"subreddits"`
}

type RawSubreddits

type RawSubreddits struct {
	Name                  string   `mapstructure:"name"`
	TitleRegex            []string `mapstructure:"title_regex"`
	NotifyTitleTemplate   string   `mapstructure:"notify_title_template"`
	NotifyMessageTemplate string   `mapstructure:"notify_message_template"`
	Notify                []string `mapstructure:"notify"`
}

type Subreddits

type Subreddits struct {
	Name                  string
	TitleRegex            []*regexp.Regexp
	NotifyTitleTemplate   *template.Template
	NotifyMessageTemplate *template.Template
	Notify                *router.ServiceRouter
}

Jump to

Keyboard shortcuts

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