database

package
v1.5.4 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2026 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddClassification

func AddClassification(db *sql.DB, name, description string, level int, color string) error

func AddClassificationRule

func AddClassificationRule(db *sql.DB, name, description, matchPattern, matchType string, classificationID, priority int) error

Adicionar regra de classificação

func AutoClassifyDocument

func AutoClassifyDocument(db *sql.DB, fileID int, matchPattern, matchType string) error

Classificar documento automaticamente

func AutoClassifyUnclassifiedDocuments

func AutoClassifyUnclassifiedDocuments(db *sql.DB) error

Classificar documentos não classificados

func ClassifyDocument

func ClassifyDocument(db *sql.DB, fileID, classificationID int, notes, classifiedBy string) error

Funções para gerenciar classificação de documentos

func DeleteClassification

func DeleteClassification(db *sql.DB, id int) error

func DeleteClassificationRule

func DeleteClassificationRule(db *sql.DB, id int) error

Excluir regra de classificação

func GetClassificationStats

func GetClassificationStats(db *sql.DB) (map[string]interface{}, error)

func GetClassifications

func GetClassifications(db *sql.DB) ([]map[string]interface{}, error)

Funções para gerenciar classificações

func GetDocumentClassification

func GetDocumentClassification(db *sql.DB, fileID int) (map[string]interface{}, error)

func GetInfrastructureAccess

func GetInfrastructureAccess(db *sql.DB) ([]map[string]interface{}, error)

func GetInfrastructureHosts

func GetInfrastructureHosts(db *sql.DB) ([]map[string]interface{}, error)

Funções para consultar dados da infraestrutura

func GetInfrastructureShares

func GetInfrastructureShares(db *sql.DB) ([]map[string]interface{}, error)

func GetInfrastructureUsers

func GetInfrastructureUsers(db *sql.DB) ([]map[string]interface{}, error)

func InitDB

func InitDB(path string) (*sql.DB, error)

func InsertDomainCredentials

func InsertDomainCredentials(db *sql.DB, domain, user, host, authMethod, passwordClear, passwordHash, passwordTicket, foundTime string, isAdmin bool) error

func InsertFile

func InsertFile(
	db *sql.DB,
	path, host, share, domain, user string,
	size int64,
	modTime time.Time,
	fileType, matchPattern, matchType, hash, localPath, sizeFormatted string,
	largeFile bool,
	leetSpeak bool,
	searchParamType, searchParamValue string,
	parentID *int,
) error

func InsertFileReturnID

func InsertFileReturnID(
	db *sql.DB,
	path, host, share, domain, user string,
	size int64,
	modTime time.Time,
	fileType, matchPattern, matchType, hash, localPath, sizeFormatted string,
	largeFile bool,
	leetSpeak bool,
	searchParamType, searchParamValue string,
	parentID *int,
) (int, error)

Função para inserir arquivo e retornar o id

func InsertLowHangingFruit

func InsertLowHangingFruit(db *sql.DB, path, host, share, domain, user string, size int64, modTime time.Time, fileType, matchPattern, matchType, sizeFormatted, scanMode string, largeFile bool) (bool, error)

func MigrateAddSearchParamsToUnique added in v1.5.4

func MigrateAddSearchParamsToUnique(db *sql.DB) error

MigrateAddSearchParamsToUnique updates the low_hanging_fruit table to include match_pattern and match_type in the UNIQUE constraint. This allows the same file to be recorded multiple times if found with different search parameters.

func PopulateInfrastructureTables

func PopulateInfrastructureTables(db *sql.DB) error

Funções para popular as tabelas de infraestrutura com dados existentes

func UpdateClassification

func UpdateClassification(db *sql.DB, id int, name, description string, level int, color string) error

func UpdateClassificationRule

func UpdateClassificationRule(db *sql.DB, id int, name, description, matchPattern, matchType string, classificationID, priority int, enabled bool) error

Atualizar regra de classificação

func UpdateFileParentID

func UpdateFileParentID(db *sql.DB, id int, parentID int) error

Função para atualizar o parent_id de um arquivo

Types

type ClassificationRule

type ClassificationRule struct {
	ID               int
	Name             string
	Description      string
	MatchPattern     string
	MatchType        string
	ClassificationID int
	Priority         int
	Enabled          bool
	CreatedAt        string
	UpdatedAt        string
}

Estrutura para regra de classificação

func GetClassificationRules

func GetClassificationRules(db *sql.DB) ([]ClassificationRule, error)

Listar regras de classificação

Jump to

Keyboard shortcuts

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