|
@@ -0,0 +1,39 @@
|
|
|
|
+package main
|
|
|
|
+
|
|
|
|
+import (
|
|
|
|
+ "log"
|
|
|
|
+
|
|
|
|
+ "gogs.carducci-dante.gov.it/karmen/core/config"
|
|
|
|
+ "gogs.carducci-dante.gov.it/karmen/core/generator/generators/list"
|
|
|
|
+)
|
|
|
|
+
|
|
|
|
+type Config struct {
|
|
|
|
+ config.ConfigT
|
|
|
|
+
|
|
|
|
+ DocumentName string `yaml:"document_name"`
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+func main() {
|
|
|
|
+ conf := new(Config)
|
|
|
|
+
|
|
|
|
+ err := config.ReadFile("config.yaml", &conf.ConfigT)
|
|
|
|
+ if err != nil {
|
|
|
|
+ panic(err)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // Upload resources on the cloud
|
|
|
|
+
|
|
|
|
+ if files, err := cloud.UploadDir("resources/*", "Documents/Example 2"); err != nil {
|
|
|
|
+ panic(err)
|
|
|
|
+ } else {
|
|
|
|
+ for _, file := range files {
|
|
|
|
+ log.Println(file, " was uploaded.")
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ gen := list.NewListGenerator(&conf.ConfigT)
|
|
|
|
+
|
|
|
|
+ gen.CloudPath = "Documents/Example 2"
|
|
|
|
+
|
|
|
|
+ gen.Run()
|
|
|
|
+}
|