-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommands.go
55 lines (43 loc) · 1019 Bytes
/
commands.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
/*
* Copyright (c) 2024. Dockovpn Solutions OÜ
*/
package go_dvpn
type Command []string
type cmds struct {
version Command
genclient Command
rmclient Command
getclient Command
listclients Command
}
var Commands cmds
func init() {
Commands = makeCommands()
}
func (c cmds) GetClient(clientId string) Command {
return append(c.getclient, clientId)
}
func (c cmds) ListClients() Command {
return c.listclients
}
func (c cmds) Version() Command {
return c.version
}
func (c cmds) GenClient() Command {
return append(c.genclient, "o")
}
func (c cmds) GenClientWithID(clientId string) Command {
return append(c.genclient, "n", clientId)
}
func (c cmds) RmClient(clientId string) Command {
return append(c.rmclient, clientId)
}
func makeCommands() cmds {
return cmds{
version: []string{"./version.sh"},
genclient: []string{"./genclient.sh"},
rmclient: []string{"./rmclient.sh"},
getclient: []string{"./getconfig.sh"},
listclients: []string{"./listconfigs.sh"},
}
}