Documentation
¶
Index ¶
- Variables
- func Hostname() (hostname string)
- func TypeError(format string, v ...any) *yaml.TypeError
- type Body
- type Config
- type Feed
- type Feeds
- type GlobalOptions
- type Map
- type Options
- type Url
- func (u Url) BaseUrl() Url
- func (u *Url) CommonBaseUrl(other Url) bool
- func (u *Url) Empty() bool
- func (u *Url) EmptyRoot() bool
- func (u *Url) ForceTLS() bool
- func (u *Url) HostPort() string
- func (u *Url) RootPath() []string
- func (u Url) String() string
- func (u *Url) UnmarshalYAML(value *yaml.Node) (err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultFeedOptions = Options{ Body: "default", MinFreq: 0, InclImages: true, EmbedImages: false, IgnHash: false, AlwaysNew: false, Disable: false, NoTLS: false, ItemFilter: "", }
View Source
var DefaultGlobalOptions = GlobalOptions{ Cache: "feed.cache", Timeout: 30, MaxFailures: 10, MaxConns: 5, DefaultEmail: username() + "@" + Hostname(), Target: Url{}, Parts: []string{"text", "html"}, AutoTarget: true, HtmlTemplate: "", TextTemplate: "", }
Functions ¶
Types ¶
type Config ¶
type Config struct {
GlobalOptions `yaml:",inline"`
FeedOptions Options `yaml:"options"`
Feeds Feeds `yaml:"-"`
}
Config holds the global configuration options and the configured feeds
func WithDefault ¶
func WithDefault() *Config
WithDefault returns a configuration initialized with default values.
type GlobalOptions ¶
type GlobalOptions struct {
Cache string `yaml:"cache"`
Timeout int `yaml:"timeout"`
DefaultEmail string `yaml:"default-email"`
Target Url `yaml:"target"`
Parts []string `yaml:"parts"`
MaxFailures int `yaml:"max-failures"`
MaxConns int `yaml:"max-imap-connections"`
AutoTarget bool `yaml:"auto-target"`
HtmlTemplate string `yaml:"html-template"`
TextTemplate string `yaml:"text-template"`
}
GlobalOptions are not feed specific
func (GlobalOptions) WithPartHtml ¶
func (opt GlobalOptions) WithPartHtml() bool
WithPartHtml marks whether 'html' part should be included in mails
func (GlobalOptions) WithPartText ¶
func (opt GlobalOptions) WithPartText() bool
WithPartText marks whether 'text' part should be included in mails
type Map ¶
Map is a convenience type for the non-mapped configuration options Mostly used for legacy options
type Options ¶
type Options struct {
MinFreq int `yaml:"min-frequency"`
InclImages bool `yaml:"include-images"`
EmbedImages bool `yaml:"embed-images"`
Disable bool `yaml:"disable"`
IgnHash bool `yaml:"ignore-hash"`
AlwaysNew bool `yaml:"always-new"`
Reupload bool `yaml:"reupload-if-updated"`
NoTLS bool `yaml:"tls-no-verify"`
ItemFilter string `yaml:"item-filter"`
Body Body `yaml:"body"`
}
Options are feed specific NB: Always specify a yaml name, as it is later used in processing
Click to show internal directories.
Click to hide internal directories.