-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy pathanalysis.go
More file actions
47 lines (39 loc) · 1.2 KB
/
analysis.go
File metadata and controls
47 lines (39 loc) · 1.2 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
package lookout
import (
"google.golang.org/grpc"
"gopkg.in/src-d/lookout-sdk.v0/pb"
)
type EventResponse = pb.EventResponse
type Comment = pb.Comment
type AnalyzerClient = pb.AnalyzerClient
type AnalyzerServer = pb.AnalyzerServer
func RegisterAnalyzerServer(s *grpc.Server, srv AnalyzerServer) {
pb.RegisterAnalyzerServer(s, srv)
}
func NewAnalyzerClient(conn *grpc.ClientConn) AnalyzerClient {
return pb.NewAnalyzerClient(conn)
}
// AnalyzerConfig is a configuration of analyzer
type AnalyzerConfig struct {
Name string
// Addr is gRPC URL.
// can be defined only in global config, repository-scoped configuration is ignored
Addr string
// Disabled repository-scoped configuration can accept only true value, false value is ignored
Disabled bool
// Feedback is a url to be linked after each comment
Feedback string
// Settings any configuration for an analyzer
Settings map[string]interface{}
}
// Analyzer is a struct of analyzer client and config
type Analyzer struct {
Client AnalyzerClient
Config AnalyzerConfig
}
// AnalyzerComments contains a group of comments and the config for the
// analyzer that created them
type AnalyzerComments struct {
Config AnalyzerConfig
Comments []*Comment
}