config

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2023 License: MIT Imports: 6 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 {
	Version  string          `yaml:"version" required:"true"`
	Actions  []action.Action `yaml:"actions"`
	Verbose  bool            `yaml:"verbose" default:"false"`
	Timezone string          `yaml:"timezone" default:"UTC"`
	Server   ServerConfig    `yaml:"server"`
	Remotes  []Remote        `yaml:"remotes"`
}

func LoadConfig

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

func (*Config) GetAction

func (cfg *Config) GetAction(name string) (*action.Action, error)

func (*Config) GetRemote added in v0.2.0

func (cfg *Config) GetRemote(name string) (*Remote, error)

func (*Config) Validate

func (cfg *Config) Validate() error

type Remote added in v0.2.0

type Remote struct {
	Name string `yaml:"name" required:"true"`
	Url  string `yaml:"url" required:"true"`
}

type ServerConfig added in v0.2.0

type ServerConfig struct {
	Enabled bool   `yaml:"enabled" default:"false"`
	Listen  string `yaml:"listen" default:":9399"`
}

func (*ServerConfig) Validate added in v0.2.0

func (sc *ServerConfig) Validate() error

Jump to

Keyboard shortcuts

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