database

package
v0.0.0-...-de93bbd Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2025 License: GPL-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ALlProcessingJobs

func ALlProcessingJobs() ([]sqlc.ProcessingJob, error)

func AddProcessingJobMessage

func AddProcessingJobMessage(jobid int64, message string) error

func Connect

func Connect() (*pgxpool.Pool, error)

func CreateFile

func CreateFile(ctx context.Context, name string, fileBytes []byte) (sqlc.File, error)

CreateFile() creates the filesystem object and the DB entry for a file

func DeleteFileByID

func DeleteFileByID(fileID string) error

func FailProcessingJob

func FailProcessingJob(jobid int64, jobErr error) error

FailProcessingJob() marks the job as completed

func FinishProcessingJob

func FinishProcessingJob(jobid int64) error

FinishProcessingJob() marks the job as completed

func GetAllFiles

func GetAllFiles() ([]sqlc.File, error)

func GetFileByID

func GetFileByID(fileID string) (sqlc.File, error)

func GetFileMime

func GetFileMime(fileID pgtype.UUID) (string, error)

GetFileMime() returns the MimeType for a file

func GetFileProperties

func GetFileProperties(fileID pgtype.UUID) (sqlc.FileProperty, error)

func GetMSOfficeResults

func GetMSOfficeResults(fileID string) (sqlc.Msoffice, error)

func GetYaraResults

func GetYaraResults(fileID string) (sqlc.YaraResult, error)

func InsertFileCapa

func InsertFileCapa(params sqlc.InsertFileCapaParams) error

func InsertFileDiec

func InsertFileDiec(params sqlc.InsertFileDIECParams) error

func InsertFileProperties

func InsertFileProperties(properties sqlc.InsertFilePropertiesParams) error

func InsertMSOfficeResults

func InsertMSOfficeResults(params sqlc.InsertMSOfficeResultsParams) error

func InsertYaraResults

func InsertYaraResults(params sqlc.InsertYaraResultsParams) error

func NewProcessingJob

func NewProcessingJob(ctx context.Context, fileid pgtype.UUID, jobType string) (sqlc.ProcessingJob, error)

NewProcessingJob() Creates a new Processing Job in the Database

func Ping

func Ping() error

func StartProcessingJob

func StartProcessingJob(jobid int64) error

StartProcessingJob() starts the job

Types

type CapaData

type CapaData struct {
	Capabilities map[string]string `json:"capabilities"`
	Maec         map[string]string `json:"maec"`
	Objectives   map[string]string `json:"objectives"`
	Tactics      map[string]string `json:"tactics"`
}

type CapaResult

type CapaResult struct {
	ID     int64
	FileID pgtype.UUID
	Data   CapaData
}

func GetFileCapa

func GetFileCapa(fileID string) (CapaResult, error)

type Diec

type Diec struct {
	ID     int64
	FileID pgtype.UUID
	Data   DiecData
}

func GetFileDiec

func GetFileDiec(fileID pgtype.UUID) (Diec, error)

type DiecData

type DiecData struct {
	Detects []struct {
		Filetype       string `json:"filetype"`
		Parentfilepart string `json:"parentfilepart"`
		Values         []struct {
			Info    string `json:"info"`
			Name    string `json:"name"`
			String  string `json:"string"`
			Type    string `json:"type"`
			Version string `json:"version"`
		} `json:"values"`
	} `json:"detects"`
}

Jump to

Keyboard shortcuts

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