-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathrequest.go
More file actions
39 lines (30 loc) · 782 Bytes
/
request.go
File metadata and controls
39 lines (30 loc) · 782 Bytes
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
package main
// struct to make requests to the scanner
type ScanRequest struct {
Filename string
ResponseChan chan *ScanResponse
}
func NewScanRequest(filename string) *ScanRequest {
scan := new(ScanRequest)
scan.Filename = filename
scan.ResponseChan = make(chan *ScanResponse)
return scan
}
type RuleSetRequest struct {
ResponseChan chan *RuleSetResponse
}
func NewRuleSetRequest() *RuleSetRequest {
rule := new(RuleSetRequest)
rule.ResponseChan = make(chan *RuleSetResponse)
return rule
}
type RuleListRequest struct {
RuleSet string
ResponseChan chan *RuleListResponse
}
func NewRuleListRequest(ruleset string) *RuleListRequest {
rule := new(RuleListRequest)
rule.RuleSet = ruleset
rule.ResponseChan = make(chan *RuleListResponse)
return rule
}