conntracker

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterAndSortNewFiles

func FilterAndSortNewFiles(cfg Config, lastProcessedTime time.Time) ([]string, time.Time, error)

func GetLastProcessedTime

func GetLastProcessedTime(cfg Config, db *sql.DB) (time.Time, error)

func InitDatabase

func InitDatabase(db *sql.DB) error

func InsertOrUpdateAccounts

func InsertOrUpdateAccounts(cfg Config, db *sql.DB, accounts map[string]AccountInfo) (uint64, uint64, error)

func OpenOrCreateDB

func OpenOrCreateDB(cfg Config) (*sql.DB, error)

func ParseAuditFile

func ParseAuditFile(cfg Config, filename string) (map[string]AccountInfo, error)

func ProcessFilesParallel

func ProcessFilesParallel(cfg Config, filenames []string) (map[string]AccountInfo, error)

func UpdateLastProcessedTime

func UpdateLastProcessedTime(cfg Config, db *sql.DB, lastProcessedTime time.Time) error

Types

type AccountInfo

type AccountInfo struct {
	Name     string
	Host     string
	LastSeen time.Time
}

type ChunkResult

type ChunkResult struct {
	Accounts map[string]AccountInfo // key is "username@hostname"
}

type Config

type Config struct {
	AuditLogPath    string
	SqlitePath      string
	TimeFormatAudit string
	TimeFormatDB    string
	TimeLocation    *time.Location
	MaxWorkers      int
	LogLevel        slog.Level
}

func InitConfig

func InitConfig() (Config, error)

type FileInfo

type FileInfo struct {
	Path    string
	ModTime time.Time
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳