Repository navigation
Expand file tree
/
Copy pathmain.go
More file actions
92 lines (77 loc) · 1.48 KB
/
Copy pathmain.go
File metadata and controls
92 lines (77 loc) · 1.48 KB
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
90
91
92
package version
import "fmt"
const (
SuiteName = "lssh-suite"
Number = "0.10.0"
)
type Maturity string
const (
Alpha Maturity = "alpha"
Beta Maturity = "beta"
Stable Maturity = "stable"
)
type Domain string
const (
Unknown Domain = "unknown"
Core Domain = "core"
Transfer Domain = "transfer"
Monitor Domain = "monitor"
Sysadmin Domain = "sysadmin"
)
type Info struct {
Suite string
Number string
Maturity Maturity
Domain Domain
}
func (i Info) String() string {
return fmt.Sprintf("%s %s (%s/%s)", i.Suite, i.Number, i.Maturity, i.Domain)
}
func ForCommand(name string) Info {
info := Info{
Suite: SuiteName,
Number: Number,
Maturity: Alpha,
Domain: Unknown,
}
switch name {
// Core
case "lssh":
info.Domain = Core
info.Maturity = Stable
// Transfer
case "lscp":
info.Domain = Transfer
info.Maturity = Stable
case "lsftp":
info.Domain = Transfer
info.Maturity = Stable
case "lssync":
info.Domain = Transfer
info.Maturity = Beta
case "lsshfs":
info.Domain = Transfer
info.Maturity = Beta
// Monitor
case "lsmon":
info.Domain = Monitor
info.Maturity = Beta
// Sysadmin
case "lsshell":
info.Domain = Sysadmin
info.Maturity = Beta
case "lsmux":
info.Domain = Sysadmin
info.Maturity = Beta
case "lsdiff":
info.Domain = Sysadmin
info.Maturity = Beta
case "lspipe":
info.Domain = Sysadmin
info.Maturity = Alpha
}
return info
}
func AppVersion(name string) string {
return ForCommand(name).String()
}