/
model.go
54 lines (44 loc) · 938 Bytes
/
model.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
package core
import (
"context"
"go.uber.org/zap"
)
type Handler interface {
concurrent(ctx context.Context)
sync(ctx context.Context)
}
// enum for error types ...
const (
Success int = iota
Failed
Error
)
// CommandOut ...
type CommandOut struct {
StdOutput []byte
StdError []byte
}
// Commands ...
type Commands struct {
Commands JsonFile `json:"commands"`
}
// JsonFile ...
type JsonFile struct {
Concurrent bool `json:"concurrent"`
List []JsonInner `json:"list"`
}
// HandlerObjects ...
type HandlerObjects struct {
Logger *zap.SugaredLogger
Config JsonInner
}
// JsonInner represents the structure of the innser json ...
type JsonInner struct {
Directory string `json:"directory"`
Concurrent bool `json:"concurrent"`
List []ListItems `json:"list"`
}
// ListItems ...
type ListItems struct {
CMD string `json:"cmd"`
}