-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathstructs.go
100 lines (88 loc) · 1.75 KB
/
structs.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
90
91
92
93
94
95
96
97
98
99
100
package main
import (
"io"
"sync"
"github.com/google/uuid"
"golang.org/x/crypto/ssh"
)
var (
Servers []*Server
Variables = make(map[string]string)
Deployment *D
ParseWaitGroup = sync.WaitGroup{}
CloseTag = "lkajbdflkajbdslkfbalkdfdeploy"
CMDFilter string
ScriptFilter string
)
type D struct {
Server string
Script string
Vars string
Variables map[string]string
}
// Server ..
type Server struct {
Key string
Password string
User string
Hostname string
IP string
Port string
Scripts []Script // list of service tags
Pre []CMD `json:"pre"`
Post []CMD `json:"post"`
Variables map[string]string
Client *ssh.Client
}
type ChannelWriter struct {
Buffer chan []byte
}
// Service ..
// This represents a base service you wish to use.
type Script struct {
Name string
CMD []CMD `json:"cmd"`
Variables map[string]string
Filter string
// Templates map[string][]byte
}
type CMD struct {
ID uuid.UUID
Done bool
Run string
Out string
Success bool
Hostname string
Filter string
Async bool
Local bool
// Experimental
Conn *ssh.Client
// File and Directory specific
File *File
Template *Template
Directory *Direcotry
ExpectedSuccessCount int
TotalSuccessCount int
// Session
StdIn io.WriteCloser
StdOut ChannelWriter
StdErr ChannelWriter
Session *ssh.Session
}
type File struct {
Local string
Remote string
Mode string
}
type Template struct {
Local string
Remote string
Data []byte
Mode string
}
type Direcotry struct {
Src string
Dst string
Mode string
}