aminal/config/config.go

23 lines
393 B
Go

package config
import (
"gitlab.com/liamg/raft/terminal"
yaml "gopkg.in/yaml.v2"
)
type Config struct {
DebugMode bool `yaml:"debug"`
ColourScheme terminal.ColourScheme
}
var DefaultConfig = Config{
DebugMode: false,
ColourScheme: terminal.DefaultColourScheme,
}
func Parse(data []byte) (*Config, error) {
c := DefaultConfig
err := yaml.Unmarshal(data, &c)
return &c, err
}