config

package
v0.0.0-...-e5420c4 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2023 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EmptyConfig     = Config{}
	ErrHome         = errors.New("unable to determine home directory")
	ErrNoConfigFile = errors.New("no config file")
)

Functions

func CreateDefaultConfig

func CreateDefaultConfig() error

func GetConfigDir

func GetConfigDir() (string, error)

func GetConfigPath

func GetConfigPath() (string, error)

func GetHomeDir

func GetHomeDir() (string, error)

Types

type Config

type Config struct {
	Server  Server  `toml:"server" json:"server"`
	General General `toml:"general" json:"general"`
}

func DefaultConfig

func DefaultConfig() Config

func LoadConfig

func LoadConfig() (Config, error)

func (Config) Markdown

func (c Config) Markdown() string

func (Config) String

func (c Config) String() string

func (Config) Validate

func (c Config) Validate() error

func (Config) WriteConfig

func (config Config) WriteConfig() error

type General

type General struct {
	ForcePort bool `toml:"force_port" json:"force_port" default:"false"`
	Browser   bool `toml:"browser" json:"browser" default:"true"`
	Discord   bool `toml:"discord" json:"discord" default:"true"`
	Workers   uint `toml:"workers" json:"workers" default:"10"`
}

type Server

type Server struct {
	Port uint64 `toml:"port" json:"port" default:"8569"`
	Ip   string `toml:"ip" json:"ip" default:"localhost"`
}

Jump to

Keyboard shortcuts

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