Skip to main content

File Scan | Golang SDK

RequestUploadURL

func (e *FileScan) RequestUploadURL(ctx context.Context, input *FileScanGetURLRequest, file *os.File) (*pangea.PangeaResponse[FileScanResult], error)

required parameters

context.Context
*os.File

Scan

func (e *FileScan) Scan(ctx context.Context, input *FileScanRequest, file *os.File) (*pangea.PangeaResponse[FileScanResult], error)

Scan a file for malicious content.

required parameters

context.Context
*os.File
input := &file_scan.FileScanRequest{
	Raw: true,
	Verbose: true,
	Provider: "crowdstrike",
}

// This should be your own file to scan
file, err := os.Open("./path/to/file.pdf")
if err != nil {
	log.Fatal("expected no error got: %v", err)
}

resp, err := client.Scan(ctx, input, file)
if err != nil {
	log.Fatal(err.Error())
}

UploadFile

func (fu *FileUploader) UploadFile(ctx context.Context, url string, tm pangea.TransferMethod, fd pangea.FileData) error

required parameters

context.Context
string
pangea.TransferMethod
pangea.FileData

Type Client

type Client interface

required parameters

func(ctx context.Context, input *FileScanRequest, file *os.File) (*pangea.PangeaResponse[FileScanResult], error)
context.Context
*os.File
func(ctx context.Context, input *FileScanGetURLRequest, file *os.File) (*pangea.PangeaResponse[FileScanResult], error)
context.Context
*os.File
pangea.BaseServicer

Base service methods

type Client interface {
	Scan(ctx context.Context, input *FileScanRequest, file *os.File) (*pangea.PangeaResponse[FileScanResult], error)
	RequestUploadURL(ctx context.Context, input *FileScanGetURLRequest, file *os.File) (*pangea.PangeaResponse[FileScanResult], error)

	// Base service methods
	pangea.BaseServicer
}

Type FileScan

type FileScan struct
type FileScan struct {
	pangea.BaseService
}

Type FileScanData

type FileScanData struct

required parameters

[]string `json:"category"`
int `json:"score"`
string `json:"verdict"`
type FileScanData struct {
	Category	[]string	`json:"category"`
	Score		int		`json:"score"`
	Verdict		string		`json:"verdict"`
}

Type FileScanFileParams

type FileScanFileParams struct

NOTE: Will be deprecated in next major update in favor of pangea.UploadFileParams

required parameters

int `json:"size,omitempty"`
string `json:"crc32c,omitempty"`
string `json:"sha256,omitempty"`
type FileScanFileParams struct {
	Size	int	`json:"size,omitempty"`
	CRC	string	`json:"crc32c,omitempty"`
	SHA256	string	`json:"sha256,omitempty"`
}

Type FileScanFullRequest

type FileScanFullRequest struct
type FileScanFullRequest struct {
	FileScanRequest
	FileScanFileParams
}

Type FileScanGetURLRequest

type FileScanGetURLRequest struct

required parameters

pangea.TransferMethod
bool
bool
string
type FileScanGetURLRequest struct {
	TransferMethod	pangea.TransferMethod
	Verbose		bool
	Raw		bool
	Provider	string
	FileParams	*FileScanFileParams
}

Type FileScanRequest

type FileScanRequest struct

required parameters

pangea.BaseRequest

Base request has ConfigID for multi-config projects

bool `json:"verbose,omitempty"`
bool `json:"raw,omitempty"`
string `json:"provider,omitempty"`
string `json:"source_url,omitempty"`
type FileScanRequest struct {
	// Base request has ConfigID for multi-config projects
	pangea.BaseRequest
	pangea.TransferRequest

	Verbose		bool	`json:"verbose,omitempty"`
	Raw		bool	`json:"raw,omitempty"`
	Provider	string	`json:"provider,omitempty"`
	SourceURL	string	`json:"source_url,omitempty"`
}

Type FileScanResult

type FileScanResult struct

required parameters

FileScanData `json:"data"`
interface{} `json:"parameters,omitempty"`
interface{} `json:"raw_data,omitempty"`
type FileScanResult struct {
	Data		FileScanData	`json:"data"`
	Parameters	interface{}	`json:"parameters,omitempty"`
	RawData		interface{}	`json:"raw_data,omitempty"`
}

Type FileUploader

type FileUploader struct

required parameters

*pangea.Client
type FileUploader struct {
	client *pangea.Client
}