config

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Validate

func Validate(t Configuration) error

Types

type Auth

type Auth struct {
	Username string `yaml:"username,omitempty"`
	Password string `yaml:"password,omitempty"`
}

type Configuration

type Configuration struct {
	Syntax string `yaml:"syntax"validate:"required,syntax"`
	Tabs   []Tab  `yaml:"tabs,omitempty"validate:"omitempty,dive"`
	Jobs   []Job  `yaml:"jobs,omitempty"validate:"omitempty,dive"`
}

func Load

func Load(filename string) (Configuration, error)

type Job

type Job struct {
	Type    string  `yaml:"type"validate:"required"`
	When    string  `yaml:"when"validate:"required"`
	Options Options `yaml:"options,omitempty"validate:"omitempty,dive"`
}

type Options

type Options struct {
	// Command
	Command string   `yaml:"command"`
	Args    []string `yaml:"args"`

	// Tab, Message
	Duration uint64 `yaml:"duration"`

	// Tab
	URL string `yaml:"url"`

	// Message
	Message         string `yaml:"message"`
	FontSize        uint64 `yaml:"fontSize"`
	TextColor       string `yaml:"textColor"`
	BackgroundColor string `yaml:"backgroundColor"`
	Blink           bool   `yaml:"blink"`
}

type Tab

type Tab struct {
	URL      string `yaml:"url"validate:"required"`
	Duration uint64 `yaml:"duration,omitempty"`
	Reload   bool   `yaml:"reload,omitempty"`
	Auth     Auth   `yaml:"auth,omitempty"validate:"omitempty,dive"`
	CSS      string `yaml:"css,omitempty"validate:"omitempty,uri"`
	JS       string `yaml:"js,omitempty"validate:"omitempty,uri"`
}

Jump to

Keyboard shortcuts

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