You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: submit.go
+74-22Lines changed: 74 additions & 22 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,7 @@
1
1
package main
2
2
3
3
import (
4
+
"errors"
4
5
"fmt"
5
6
"log"
6
7
"os"
@@ -16,13 +17,15 @@ import (
16
17
17
18
"github.com/Pallinder/go-randomdata"
18
19
"github.com/alexflint/go-arg"
19
-
"github.com/peterhellberg/duration"
20
20
"github.com/ovh/go-ovh/ovh"
21
+
"github.com/peterhellberg/duration"
21
22
"gopkg.in/ini.v1"
22
23
)
23
24
24
25
const (
25
26
LoopWaitSecond=2
27
+
OVHConfig="ovh"
28
+
SwiftConfig="swift"
26
29
)
27
30
28
31
var (
@@ -43,14 +46,15 @@ var (
43
46
Packagesstring`arg:"--packages" help:"Comma-delimited list of Maven coordinates"`
44
47
Repositoriesstring`arg:"--repositories" help:"Comma-delimited list of additional repositories (or resolvers in SBT)"`
45
48
PropertiesFilestring`arg:"--properties-file" help:"Read properties from the given file"`
46
-
Ttlstring`arg:"--ttl" help:"Maximum \"Time To Live\" (in RFC3339 (duration) eg. "P1DT30H4S") of this job, after which it will be automatically terminated"`
49
+
TTLstring`arg:"--ttl" help:"Maximum \"Time To Live\" (in RFC3339 (duration) eg. \"P1DT30H4S\") of this job, after which it will be automatically terminated"`
47
50
Filestring`arg:"positional,required"`
48
51
Parameters []string`arg:"positional"`
49
52
}
50
53
)
51
54
52
55
var (
53
-
configPath="configuration.ini"
56
+
configPath="configuration.ini"
57
+
SupportedProtocols= []string{SwiftConfig}
54
58
)
55
59
56
60
type (
@@ -73,6 +77,11 @@ func main() {
73
77
log.Fatalf("Unable to load conf: %s", err)
74
78
}
75
79
80
+
protocols, err:=validConfig(conf)
81
+
iferr!=nil {
82
+
log.Fatalf("Invalid conf: %s", err)
83
+
}
84
+
76
85
ovhConf:=new(OVHConf)
77
86
iferr:=conf["ovh"].MapTo(ovhConf); err!=nil {
78
87
log.Fatalf("Unable to parse \"ovh\" conf: %s", err)
0 commit comments