all repos — flounder @ e7763a0743e1b07d9e9b6925848975597bdfd3f3

A small site builder for the Gemini protocol

config.go (view raw)

 1package main
 2
 3import (
 4	"github.com/BurntSushi/toml"
 5)
 6
 7type Config struct {
 8	FilesDirectory string
 9	RootDomain     string
10	SiteTitle      string
11	Debug          bool
12	SecretKey      string
13}
14
15func getConfig(filename string) (Config, error) {
16	var config Config
17	// Attempt to overwrite defaults from file
18	_, err := toml.DecodeFile(filename, &config)
19	if err != nil {
20		return config, err
21	}
22	return config, nil
23}