arns-lt-tree-push-service/main.go

43 lines
752 B
Go
Raw Normal View History

2022-08-02 08:16:11 +03:00
package main
import (
"flag"
"time"
)
var (
2024-01-10 08:34:50 +02:00
source string
key string
meta = []string{
"description",
"lang",
"copyright",
"created",
2025-01-12 00:47:25 +02:00
"app",
2024-01-10 08:34:50 +02:00
} //_ = zord_tree.PopulateTree(cfg.MdTree.Path, cfg.MdTree.DPath, meta)
2022-08-02 08:16:11 +03:00
customMeta = make(map[string]func() string)
)
func init() {
flag.StringVar(&source, "source", "", "source to collect texts.")
2022-08-22 22:53:27 +03:00
flag.StringVar(&key, "key", "", "secret key for authenticated communication.")
2022-08-02 08:16:11 +03:00
flag.Parse()
customMeta["copyright"] = func() string {
return "CC-BY-SA 4.0"
}
customMeta["created"] = func() string {
currentTime := time.Now()
return currentTime.Format("2006-01-02")
}
}
func main() {
switch action := flag.Arg(0); action {
case "collect":
Collect()
default:
Run()
}
}