-
Notifications
You must be signed in to change notification settings - Fork 55
/
generic.go
89 lines (71 loc) · 1.95 KB
/
generic.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
package generic
import (
commandsutils "github.com/jfrog/jfrog-cli-core/artifactory/commands/utils"
"github.com/jfrog/jfrog-cli-core/artifactory/spec"
"github.com/jfrog/jfrog-cli-core/utils/config"
)
type GenericCommand struct {
serverDetails *config.ServerDetails
spec *spec.SpecFiles
result *commandsutils.Result
dryRun bool
detailedSummary bool
syncDeletesPath string
quiet bool
retries int
}
func NewGenericCommand() *GenericCommand {
return &GenericCommand{result: new(commandsutils.Result)}
}
func (gc *GenericCommand) DryRun() bool {
return gc.dryRun
}
func (gc *GenericCommand) SetDryRun(dryRun bool) *GenericCommand {
gc.dryRun = dryRun
return gc
}
func (gc *GenericCommand) SyncDeletesPath() string {
return gc.syncDeletesPath
}
func (gc *GenericCommand) SetSyncDeletesPath(syncDeletes string) *GenericCommand {
gc.syncDeletesPath = syncDeletes
return gc
}
func (gc *GenericCommand) Quiet() bool {
return gc.quiet
}
func (gc *GenericCommand) SetQuiet(quiet bool) *GenericCommand {
gc.quiet = quiet
return gc
}
func (gc *GenericCommand) Retries() int {
return gc.retries
}
func (gc *GenericCommand) SetRetries(retries int) *GenericCommand {
gc.retries = retries
return gc
}
func (gc *GenericCommand) Result() *commandsutils.Result {
return gc.result
}
func (gc *GenericCommand) Spec() *spec.SpecFiles {
return gc.spec
}
func (gc *GenericCommand) SetSpec(spec *spec.SpecFiles) *GenericCommand {
gc.spec = spec
return gc
}
func (gc *GenericCommand) ServerDetails() (*config.ServerDetails, error) {
return gc.serverDetails, nil
}
func (gc *GenericCommand) SetServerDetails(serverDetails *config.ServerDetails) *GenericCommand {
gc.serverDetails = serverDetails
return gc
}
func (gc *GenericCommand) DetailedSummary() bool {
return gc.detailedSummary
}
func (gc *GenericCommand) SetDetailedSummary(detailedSummary bool) *GenericCommand {
gc.detailedSummary = detailedSummary
return gc
}