scan

package
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContentScanPayload

type ContentScanPayload struct {
	Filename string `json:"filename"` // <= 256 characters
	Document string `json:"document"`
}

ContentScanPayload this shouldn't exceed 1MB.

type ContentScanResponse

type ContentScanResponse struct {
	PolicyBreakCount int64         `json:"policy_break_count"`
	Policies         []string      `json:"policies"`
	PolicyBreaks     []PolicyBreak `json:"policy_breaks"`
}

type ContentScanResult

type ContentScanResult struct {
	Result ContentScanResponse `json:"result"`
	Error  *Error              `json:"error"`
}

type Error

type Error struct {
	Detail string `json:"detail"`
}

type Match

type Match struct {
	Type       string `json:"type"`
	Match      string `json:"match"`
	IndexStart int64  `json:"index_start"`
	IndexEnd   int64  `json:"index_end"`
	LineStart  int64  `json:"line_start"`
	LineEnd    int64  `json:"line_end"`
}

type MultipleContentScanPayload

type MultipleContentScanPayload []ContentScanPayload

MultipleContentScanPayload this shouldn't exceed 2MB.

type MultipleContentScanResponse

type MultipleContentScanResponse []ContentScanResponse

type MultipleContentScanResult

type MultipleContentScanResult struct {
	Result []ContentScanResponse `json:"result"`
	Error  *Error                `json:"error"`
}

type PolicyBreak

type PolicyBreak struct {
	Type     string  `json:"type"`
	Policy   string  `json:"policy"`
	Matches  []Match `json:"matches"`
	Validity string  `json:"validity"`
}

type QuotaContent

type QuotaContent struct {
	Count     int64  `json:"count"`
	Limit     int64  `json:"limit"`
	Remaining int64  `json:"remaining"`
	Since     string `json:"since"`
}

type QuotaResponse

type QuotaResponse struct {
	Content QuotaContent `json:"content"`
}

type QuotaResult

type QuotaResult struct {
	Result QuotaResponse `json:"result"`
	Error  *Error        `json:"error"`
}

type ScanClient

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

func NewClient

func NewClient(opts ...client.ClientOption) (*ScanClient, error)

func (*ScanClient) ContentScan

func (c *ScanClient) ContentScan(payload ContentScanPayload) (*ContentScanResult, error)

func (*ScanClient) MultipleContentScan

func (c *ScanClient) MultipleContentScan(payload []ContentScanPayload) (*MultipleContentScanResult, error)

func (*ScanClient) Quota

func (c *ScanClient) Quota() (*QuotaResult, error)

Jump to

Keyboard shortcuts

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