aboutsummaryrefslogtreecommitdiff
path: root/internal/config/yaml.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/config/yaml.go')
-rw-r--r--internal/config/yaml.go20
1 files changed, 19 insertions, 1 deletions
diff --git a/internal/config/yaml.go b/internal/config/yaml.go
index 335dede..aa58685 100644
--- a/internal/config/yaml.go
+++ b/internal/config/yaml.go
@@ -1,6 +1,14 @@
package config
-import "fmt"
+import (
+ "fmt"
+ "gopkg.in/yaml.v3"
+)
+
+type config struct {
+ GlobalConfig Map `yaml:",inline"`
+ Feeds []configGroupFeed
+}
type Group struct {
Group string
@@ -32,6 +40,16 @@ func (grpFeed *configGroupFeed) target() string {
return grpFeed.Group.Group
}
+func parse(buf []byte) (config, error) {
+ var parsedCfg config
+ if err := yaml.Unmarshal(buf, &parsedCfg); err != nil {
+ return parsedCfg, fmt.Errorf("while unmarshalling: %w", err)
+ }
+ fmt.Printf("--- parsedCfg:\n%+v\n\n", parsedCfg)
+
+ return parsedCfg, nil
+}
+
func appTarget(target, app string) string {
if target == "" {
return app
010-04-07 14:07:11 +0200'>2010-04-07Fixed CSS; added stuff for TOCRené 'Necoro' Neumann1-8/+19 2010-04-07Renamed 'menu' to the correct 'toc'René 'Necoro' Neumann2-8/+8 2010-04-07Default argument for 404René 'Necoro' Neumann1-1/+1 2010-04-07Javascript to generate TOCsRené 'Necoro' Neumann4-1/+63