detect

package
v0.0.0-...-b5b2af5 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Convert2ReportEvent

func Convert2ReportEvent(fs api.FileSystem, info FileInfo, res Result) (*event.Event, error)

Types

type FileInfo

type FileInfo struct {
	Path        string
	Reader      io.Reader
	RawFileInfo fs.FileInfo
	ScriptType  filter.ScriptType
}

type Kit

type Kit struct {
	// contains filtered or unexported fields
}

func NewKit

func NewKit(ctx context.Context, opts ...KitOption) (*Kit, error)

func (*Kit) Detect

func (k *Kit) Detect(info FileInfo) (*Result, error)

type KitOption

type KitOption func(kit *Kit)

func WithClient

func WithClient(client *http.Client) KitOption

func WithDefaultClient

func WithDefaultClient() KitOption

func WithDefaultToken

func WithDefaultToken() KitOption

func WithToken

func WithToken(token string) KitOption

type Result

type Result struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
	Data    struct {
		RiskLevel int    `json:"risk_level"`
		ID        string `json:"id"`
		Type      string `json:"type"`
		Reason    string `json:"reason"`
		Engine    string `json:"engine"`
	} `json:"data"`
}

Jump to

Keyboard shortcuts

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