Remove a bunch more cruft

This commit is contained in:
James Mills
2022-10-05 11:19:27 +10:00
parent a07f747eb1
commit 2ba2451108
9 changed files with 10 additions and 85 deletions

View File

@@ -7,21 +7,12 @@ import (
"net/url"
"strings"
"time"
"github.com/gabstv/merger"
log "github.com/sirupsen/logrus"
)
var (
ErrConfigPathMissing = errors.New("error: config file missing")
)
// Settings contains Pod Settings that can be customised via the Web UI
type Settings struct {
Name string `yaml:"pod_name"`
Description string `yaml:"pod_description"`
}
// Config contains the server configuration parameters
type Config struct {
Debug bool
@@ -59,18 +50,6 @@ func (c *Config) IsLocalURL(url string) bool {
}
func (c *Config) LocalURL() *url.URL { return c.baseURL }
// Settings returns a `Settings` struct containing pod settings that can
// then be persisted to disk to override some configuration options.
func (c *Config) Settings() *Settings {
settings := &Settings{}
if err := merger.MergeOverwrite(settings, c); err != nil {
log.WithError(err).Warn("error creating pod settings")
}
return settings
}
// RandomSearchPrompt returns a random Search Prompt for display by the UI
func (c *Config) RandomSearchPrompt() string {
n := rand.Int() % len(c.SearchPrompts)