client

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	WithRawResponse *RawClient
	Health          *health.Client
	Scans           *scans.Client
	// contains filtered or unexported fields
}

func NewClient

func NewClient(opts ...option.RequestOption) *Client

func (*Client) Scan

func (c *Client) Scan(
	ctx context.Context,

	file io.Reader,
	opts ...option.RequestOption,
) (*detectant.Scan, error)

Uploads one file and synchronously runs content-type and malware analysis. Only the first multipart part named `file` with a filename is scanned; other parts are ignored. Free accounts accept files up to 50 MB; Grow and Scale accounts accept files up to 250 MB. Direct API uploads never exceed 250 MB; S3 integration limits are separate.

Example:

client.Scan(
    context.TODO(),
    strings.NewReader(
        "",
    ),
)

func (*Client) ScanBatch

func (c *Client) ScanBatch(
	ctx context.Context,

	files []io.Reader,
	opts ...option.RequestOption,
) (*detectant.ScanBatchResponse, error)

Uploads between 1 and 20 files in repeated `files` multipart parts. Each file uses its account plan's 50 MB or 250 MB per-file limit, validation, content-type analysis, malware detection, persistence, usage accounting, and billing path as `createScan`. The encoded multipart request limit is the plan's per-file limit × 20 plus 1 MiB for multipart framing.

Results preserve submitted-file order. File-level validation or scanner failures are returned in the corresponding result and do not prevent other files from being scanned. The whole request is rejected only for request-level failures such as invalid multipart data, authentication or rate-limit failure, more than 20 files, or an oversized total request.

Example:

client.ScanBatch(
    context.TODO(),
    nil,
)

type RawClient

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

func NewRawClient

func NewRawClient(options *core.RequestOptions) *RawClient

func (*RawClient) Scan

func (r *RawClient) Scan(
	ctx context.Context,

	file io.Reader,
	opts ...option.RequestOption,
) (*core.Response[*detectant.Scan], error)

func (*RawClient) ScanBatch

func (r *RawClient) ScanBatch(
	ctx context.Context,

	files []io.Reader,
	opts ...option.RequestOption,
) (*core.Response[*detectant.ScanBatchResponse], error)

Jump to

Keyboard shortcuts

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