config

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2022 License: MIT Imports: 3 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 {
	Pages  []Page `yaml:"pages"`
	Notify Notify `yaml:"notify"`
}

Config represents the configuration for the application.

func Load

func Load(path string) (*Config, error)

Load generates and loads the configuration by a specified path. Returns an error if the lookup failed or the yaml could not be unmarshalled.

type Email

type Email struct {
	Address   string   `yaml:"address"`
	Port      string   `yaml:"port"`
	User      string   `yaml:"user"`
	Password  string   `yaml:"password"`
	Receivers []string `yaml:"receivers"`
}

Email represents SMTP email credentials.

type Notify

type Notify struct {
	Email *Email `yaml:"email"`
	Slack *Slack `yaml:"slack"`
}

Notify represents the notification settings for when an element has changed in the DOM.

type Page

type Page struct {
	URL      string `yaml:"url"`
	Selector string `yaml:"selector"`
	Schedule string `yaml:"schedule"`
}

Page represents a singular Pages to monitor.

type Slack

type Slack struct {
	Token     string `yaml:"token"`
	ChannelID string `yaml:"channel_id"`
}

Slack represents the Slack credentials configuration.

Jump to

Keyboard shortcuts

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