-
Notifications
You must be signed in to change notification settings - Fork 88
/
abyss_api.go
42 lines (35 loc) · 963 Bytes
/
abyss_api.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
package visual
import (
lexutil "github.com/bluesky-social/indigo/lex/util"
)
type AbyssScanResp struct {
Blob *lexutil.LexBlob `json:"blob"`
Match *AbyssMatchResult `json:"match,omitempty"`
Classify *AbyssClassifyResult `json:"classify,omitempty"`
Review *AbyssReviewState `json:"review,omitempty"`
}
type AbyssMatchResult struct {
Status string `json:"status"`
Hits []AbyssMatchHit `json:"hits"`
}
type AbyssMatchHit struct {
HashType string `json:"hashType,omitempty"`
HashValue string `json:"hashValue,omitempty"`
Label string `json:"label,omitempty"`
// TODO: Corpus
}
type AbyssClassifyResult struct {
// TODO
}
type AbyssReviewState struct {
State string `json:"state,omitempty"`
TicketID string `json:"ticketId,omitempty"`
}
func (amr *AbyssMatchResult) IsAbuseMatch() bool {
for _, hit := range amr.Hits {
if hit.Label == "csam" || hit.Label == "csem" {
return true
}
}
return false
}