-
Notifications
You must be signed in to change notification settings - Fork 1
/
types.go
61 lines (51 loc) · 1.36 KB
/
types.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
package languagetool
const (
URL string = `https://languagetool.org/api/v2/check`
)
type Warnings struct {
IncompleteResults bool `json:"incompleteResults"`
}
type Software struct {
Name string `json:"name"`
Version string `json:"version"`
BuildDate string `json:"buildDate"`
APIVersion int `json:"apiVersion"`
Status string `json:"status"`
}
type Language struct {
Name string `json:"name"`
Code string `json:"code"`
}
type Result struct {
Software Software `json:"software"`
Warnings Warnings `json:"warnings"`
Language Language `json:"language"`
Matches []Match `json:"matches"`
}
type Match struct {
Message string `json:"message"`
ShortMessage string `json:"shortMessage"`
Replacements []Replacement `json:"replacements"`
Offset int `json:"offset"`
Length int `json:"length"`
Context Context `json:"context"`
Rule Rule `json:"rule"`
}
type Replacement struct {
Value string `json:"value"`
}
type Context struct {
Text string `json:"text"`
Offset int `json:"offset"`
Length int `json:"length"`
}
type Rule struct {
ID string `json:"id"`
Description string `json:"description"`
IssueType string `json:"issueType"`
Category Category `json:"category"`
}
type Category struct {
ID string `json:"id"`
Name string `json:"name"`
}