internal

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitialModel

func InitialModel() model

Types

type Config

type Config struct {
	Database             DatabaseConfig `json:"database"`
	Queries              []QueryConfig  `json:"queries"`
	BaseNotificationURL  string         `json:"baseNotificationUrl"`
	NotificationMessage  string         `json:"notificationMessage"`
	CheckIntervalSeconds int            `json:"checkIntervalSeconds"`
}

func NewDefaultConfig

func NewDefaultConfig() Config

func (*Config) AddQuery

func (c *Config) AddQuery(newQuery QueryConfig)

func (*Config) DeleteQueryByIndex

func (c *Config) DeleteQueryByIndex(index int)

func (*Config) GetQueryNames

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

func (*Config) LoadFromFile

func (c *Config) LoadFromFile(filename string) error

func (Config) SaveToFile

func (c Config) SaveToFile(filename string) error

func (*Config) UpdateDB

func (c *Config) UpdateDB(newDB DatabaseConfig)

func (*Config) UpdateQuery

func (c *Config) UpdateQuery(index int, newQuery QueryConfig)

func (*Config) UpdateSettings

func (c *Config) UpdateSettings(newSettings *Config)

type DatabaseConfig

type DatabaseConfig struct {
	Username string `json:"username"`
	Password string `json:"password"`
	Host     string `json:"host"`
	Port     string `json:"port"`
	Name     string `json:"name"`
}

type QueryConfig

type QueryConfig struct {
	Name            string `json:"name"`
	Query           string `json:"query"`
	NotificationURL string `json:"notificationUrl"`
	Disabled        bool   `json:"disabled"`
}

Jump to

Keyboard shortcuts

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