package main import ( "log" "github.com/remogatto/cloud" "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) } log.Printf("Connecting to the cloud...") client, err := cloud.Dial( conf.Cloud.Url, conf.Cloud.Username, conf.Cloud.Password, ) if err != nil { log.Println(err) } err = client.Mkdir("Documents/Example 2") if err != nil { panic(err) } // Upload resources on the cloud if files, err := client.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() }