all repos — flounder @ 19944763fc195d2db224147841ebcbf2aafb435d

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	FilesPath  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}