visual

package
v0.0.0-...-ef8e99b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 3, 2024 License: Apache-2.0, MIT Imports: 16 Imported by: 0

Documentation

Overview

automod helpers for visual content (image blobs)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AbyssClassifyResult

type AbyssClassifyResult struct {
}

type AbyssClient

type AbyssClient struct {
	Client          http.Client
	Host            string
	Password        string
	RatelimitBypass string
}

func NewAbyssClient

func NewAbyssClient(host, password, ratelimitBypass string) AbyssClient

func (*AbyssClient) AbyssScanBlobRule

func (ac *AbyssClient) AbyssScanBlobRule(c *automod.RecordContext, blob lexutil.LexBlob, data []byte) error

func (*AbyssClient) ScanBlob

func (ac *AbyssClient) ScanBlob(ctx context.Context, blob lexutil.LexBlob, blobBytes []byte, params map[string]string) (*AbyssScanResp, error)

type AbyssMatchHit

type AbyssMatchHit struct {
	HashType  string `json:"hashType,omitempty"`
	HashValue string `json:"hashValue,omitempty"`
	Label     string `json:"label,omitempty"`
}

type AbyssMatchResult

type AbyssMatchResult struct {
	Status string          `json:"status"`
	Hits   []AbyssMatchHit `json:"hits"`
}

func (*AbyssMatchResult) IsAbuseMatch

func (amr *AbyssMatchResult) IsAbuseMatch() bool

type AbyssReviewState

type AbyssReviewState struct {
	State    string `json:"state,omitempty"`
	TicketID string `json:"ticketId,omitempty"`
}

type AbyssScanResp

type AbyssScanResp struct {
	Blob     *lexutil.LexBlob     `json:"blob"`
	Match    *AbyssMatchResult    `json:"match,omitempty"`
	Classify *AbyssClassifyResult `json:"classify,omitempty"`
	Review   *AbyssReviewState    `json:"review,omitempty"`
}

type HiveAIClient

type HiveAIClient struct {
	Client   http.Client
	ApiToken string
}

func NewHiveAIClient

func NewHiveAIClient(token string) HiveAIClient

func (*HiveAIClient) HiveLabelBlobRule

func (hal *HiveAIClient) HiveLabelBlobRule(c *automod.RecordContext, blob lexutil.LexBlob, data []byte) error

func (*HiveAIClient) LabelBlob

func (hal *HiveAIClient) LabelBlob(ctx context.Context, blob lexutil.LexBlob, blobBytes []byte) ([]string, error)

type HiveAIResp

type HiveAIResp struct {
	Status []HiveAIResp_Status `json:"status"`
}

schema: https://docs.thehive.ai/reference/classification

func (*HiveAIResp) SummarizeLabels

func (resp *HiveAIResp) SummarizeLabels() []string

type HiveAIResp_Class

type HiveAIResp_Class struct {
	Class string  `json:"class"`
	Score float64 `json:"score"`
}

type HiveAIResp_Out

type HiveAIResp_Out struct {
	Time    float64            `json:"time"`
	Classes []HiveAIResp_Class `json:"classes"`
}

type HiveAIResp_Response

type HiveAIResp_Response struct {
	Output []HiveAIResp_Out `json:"output"`
}

type HiveAIResp_Status

type HiveAIResp_Status struct {
	Response HiveAIResp_Response `json:"response"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL