configs

package
v0.0.0-...-66e7bdd Latest Latest
Warning

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

Go to latest
Published: Mar 21, 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 {
	Feeds     []FeedConfig `yaml:"feeds"`
	Env       EnvConfig
	Dashboard Dashboard `yaml:"dashboard"`
}

func NewConfig

func NewConfig(configYml []byte) (*Config, error)

func (*Config) FeedByName

func (c *Config) FeedByName(name string) *FeedConfig

type Content

type Content struct {
	Type   string   `yaml:"type"`
	Styles []string `yaml:"styles"`
	Text   string   `yaml:"text"`
}

type Dashboard

type Dashboard struct {
	Title        string            `yaml:"title"`
	Meta         map[string]string `yaml:"meta,omitempty"`
	CustomStyles map[string]string `yaml:"customStyles,omitempty"`
	Layers       []Layer           `yaml:"layers"`
}

type EnvConfig

type EnvConfig struct {
	RedisUrl      string `env:"REDIS_URL"`
	RedisAddress  string `env:"REDIS_ADDRESS"`
	RedisUsername string `env:"REDIS_USERNAME"`
	RedisPassword string `env:"REDIS_PASSWORD"`
	RedisDatabase int    `env:"REDIS_DATABASE"`

	Port         string        `env:"PORT" envDefault:"8080"`
	Address      string        `env:"ADDRESS" envDefault:"0.0.0.0"`
	TickDuration time.Duration `env:"TICK_DURATION" envDefault:"15m"`
}

EnvConfig contains values expected from the environment

type FeedConfig

type FeedConfig struct {
	Name     string       `yaml:"name"`
	Query    FeedQuery    `yaml:"query"`
	Schedule FeedSchedule `yaml:"schedule"`
	Store    []FeedStore  `yaml:"store"`
}

type FeedQuery

type FeedQuery struct {
	Headers map[string]string `yaml:"headers"`
	Params  map[string]string `yaml:"params"`
	Url     string            `yaml:"url"`
	Method  string            `yaml:"method"`
	Body    string            `yaml:"body"`
	Status  int               `yaml:"status"`
}

type FeedSchedule

type FeedSchedule struct {
	Every string `yaml:"every"`
}

type FeedStore

type FeedStore struct {
	Name    string `yaml:"name"`
	Path    string `yaml:"path"`
	IsArray bool   `yaml:"isArray,omitempty"`
}

type Layer

type Layer struct {
	Name     string    `yaml:"name"`
	Title    string    `yaml:"title,omitempty"`
	X        int       `yaml:"x"`
	Y        int       `yaml:"y"`
	Width    int       `yaml:"width"`
	Height   int       `yaml:"height"`
	Layout   string    `yaml:"layout"`
	Contents []Content `yaml:"contents"`
}

Jump to

Keyboard shortcuts

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