main.go 681 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. package main
  2. import (
  3. "log"
  4. "gogs.carducci-dante.gov.it/karmen/core/config"
  5. "gogs.carducci-dante.gov.it/karmen/core/generator/generators/list"
  6. )
  7. type Config struct {
  8. config.ConfigT
  9. DocumentName string `yaml:"document_name"`
  10. }
  11. func main() {
  12. conf := new(Config)
  13. err := config.ReadFile("config.yaml", &conf.ConfigT)
  14. if err != nil {
  15. panic(err)
  16. }
  17. // Upload resources on the cloud
  18. if files, err := cloud.UploadDir("resources/*", "Documents/Example 2"); err != nil {
  19. panic(err)
  20. } else {
  21. for _, file := range files {
  22. log.Println(file, " was uploaded.")
  23. }
  24. }
  25. gen := list.NewListGenerator(&conf.ConfigT)
  26. gen.CloudPath = "Documents/Example 2"
  27. gen.Run()
  28. }