xodbox

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const ConfigFileName = "xodbox.yaml"
View Source
const DefaultNotifyFilter = "^/l"

Variables

View Source
var EmbeddedConfig embed.FS

Functions

func EmbeddedConfigReadFile added in v0.0.7

func EmbeddedConfigReadFile(name string) ([]byte, error)

func Open

func Open(name string) (fs.File, error)

func ReadDir

func ReadDir(name string) ([]fs.DirEntry, error)

Types

type App

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

func NewApp

func NewApp(config *Config) *App

func (*App) GetTemplateData

func (x *App) GetTemplateData() map[string]string

func (*App) RegisterNotificationHandler

func (x *App) RegisterNotificationHandler(n types.Notifier)

func (*App) Run

func (x *App) Run()

type Config

type Config struct {
	TemplateData map[string]string `yaml:"template_data"`
	Handlers     []types.Handler
	Notifiers    []types.Notifier
}

Config used by App for bootstrapping

func LoadConfig

func LoadConfig(configFile string) *Config

LoadConfig creates a Config from the yaml contents in configFile

type ConfigFile

type ConfigFile struct {
	Defaults  map[string]string   `yaml:"defaults"`
	Handlers  []map[string]string `yaml:"handlers"`
	Notifiers []map[string]string `yaml:"notifiers"`
}

ConfigFile defines th structure of the YAML config files This allows us to generalize the config

func (*ConfigFile) ToConfig

func (conf *ConfigFile) ToConfig() *Config

ToConfig creates a Config struct based on the ConfigFile

Jump to

Keyboard shortcuts

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