From a7a5eee66ff685e4094540e84c9c4994d30811ab Mon Sep 17 00:00:00 2001 From: davy Date: Sat, 29 Jun 2019 17:02:05 -0500 Subject: docs --- pkg/app/config.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'pkg/app/config.go') diff --git a/pkg/app/config.go b/pkg/app/config.go index 12cf21d..f8ca2e8 100644 --- a/pkg/app/config.go +++ b/pkg/app/config.go @@ -5,17 +5,20 @@ import ( "os" ) +// Config settings for main App. type Config struct { LibraryPath string `json:"library"` Server *ServerConfig `json:"server"` Feed *FeedConfig `json:"feed"` } +// ServerConfig settings for App Server. type ServerConfig struct { Host string `json:"host"` Port int `json:"port"` } +// FeedConfig settings for App Feed. type FeedConfig struct { ExternalURL string `json:"external_url"` Title string `json:"title"` @@ -28,6 +31,7 @@ type FeedConfig struct { Copyright string `json:"copyright"` } +// DefaultConfig returns Config initialized with default values. func DefaultConfig() *Config { return &Config{ LibraryPath: "videos", @@ -41,6 +45,7 @@ func DefaultConfig() *Config { } } +// ReadFile reads a JSON file into Config. func (c *Config) ReadFile(path string) error { f, err := os.Open(path) if err != nil { -- cgit v1.2.3