sqlite

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2026 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

Package sqlite implements the aitm storage interfaces using SQLite.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bots

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

Bots implements bot telemetry and signature persistence backed by SQLite.

func NewBotStore

func NewBotStore(db *DB) *Bots

func (*Bots) CreateBotSignature

func (s *Bots) CreateBotSignature(sig aitm.BotSignature) error

func (*Bots) DeleteBotSignature

func (s *Bots) DeleteBotSignature(ja4Hash string) error

func (*Bots) DeleteBotTelemetry

func (s *Bots) DeleteBotTelemetry(sessionID string) error

func (*Bots) GetBotTelemetry

func (s *Bots) GetBotTelemetry(sessionID string) ([]*aitm.BotTelemetry, error)

func (*Bots) ListBotSignatures

func (s *Bots) ListBotSignatures() ([]aitm.BotSignature, error)

func (*Bots) StoreBotTelemetry

func (s *Bots) StoreBotTelemetry(t *aitm.BotTelemetry) error

type DB

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

DB is the shared SQLite connection. Open once; pass to each domain store constructor.

func Open

func Open(path string) (*DB, error)

Open opens (or creates) the SQLite database at path, enables WAL mode and foreign key enforcement, then runs all pending migrations. Pass ":memory:" for an ephemeral database suitable for tests.

func (*DB) Close

func (d *DB) Close() error

func (*DB) WithTx

func (d *DB) WithTx(fn func(*sql.Tx) error) error

WithTx executes fn inside a transaction. If fn returns an error the transaction is rolled back; otherwise it is committed.

type Lures

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

Lures implements the lureStore interface defined in the aitm package.

func NewLureStore

func NewLureStore(db *DB) *Lures

func (*Lures) CreateLure

func (s *Lures) CreateLure(l *aitm.Lure) error

func (*Lures) DeleteLure

func (s *Lures) DeleteLure(id string) error

func (*Lures) GetLure

func (s *Lures) GetLure(id string) (*aitm.Lure, error)

func (*Lures) ListLures

func (s *Lures) ListLures() ([]*aitm.Lure, error)

func (*Lures) UpdateLure

func (s *Lures) UpdateLure(l *aitm.Lure) error

type Notifications

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

Notifications implements the notificationStore interface defined in the aitm package.

func NewNotificationStore

func NewNotificationStore(db *DB) *Notifications

func (*Notifications) CreateChannel

func (s *Notifications) CreateChannel(ch *aitm.NotificationChannel) error

func (*Notifications) DeleteChannel

func (s *Notifications) DeleteChannel(id string) error

func (*Notifications) GetChannel

func (s *Notifications) GetChannel(id string) (*aitm.NotificationChannel, error)

func (*Notifications) ListChannels

func (s *Notifications) ListChannels() ([]*aitm.NotificationChannel, error)

type Operators added in v0.2.0

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

Operators implements the operatorStore interface defined in the aitm package.

func NewOperatorStore added in v0.2.0

func NewOperatorStore(db *DB) *Operators

func (*Operators) ConsumeInvite added in v0.2.0

func (s *Operators) ConsumeInvite(token string) (*aitm.OperatorInvite, error)

func (*Operators) CreateInvite added in v0.2.0

func (s *Operators) CreateInvite(invite *aitm.OperatorInvite) error

func (*Operators) CreateOperator added in v0.2.0

func (s *Operators) CreateOperator(op *aitm.Operator) error

func (*Operators) DeleteOperator added in v0.2.0

func (s *Operators) DeleteOperator(name string) error

func (*Operators) ListInvites added in v0.2.0

func (s *Operators) ListInvites() ([]*aitm.OperatorInvite, error)

func (*Operators) ListOperators added in v0.2.0

func (s *Operators) ListOperators() ([]*aitm.Operator, error)

type Phishlets

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

Phishlets implements the phishletStore interface defined in the aitm package.

func NewPhishletStore

func NewPhishletStore(db *DB) *Phishlets

func (*Phishlets) DeletePhishlet

func (s *Phishlets) DeletePhishlet(name string) error

func (*Phishlets) GetConfig added in v0.3.0

func (s *Phishlets) GetConfig(name string) (*aitm.PhishletConfig, error)

func (*Phishlets) GetPhishlet

func (s *Phishlets) GetPhishlet(name string) (string, error)

func (*Phishlets) ListConfigs added in v0.3.0

func (s *Phishlets) ListConfigs(filter aitm.PhishletFilter) ([]*aitm.PhishletConfig, error)

func (*Phishlets) ListPhishlets

func (s *Phishlets) ListPhishlets() ([]string, error)

func (*Phishlets) SavePhishlet added in v0.3.0

func (s *Phishlets) SavePhishlet(name string, yaml string) error

func (*Phishlets) SetConfig added in v0.3.0

func (s *Phishlets) SetConfig(cfg *aitm.PhishletConfig) error

type Sessions

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

Sessions implements the sessionStore interface defined in the aitm package.

func NewSessionStore

func NewSessionStore(db *DB, cipher *aes.Cipher) *Sessions

func (*Sessions) CountSessions

func (s *Sessions) CountSessions(f aitm.SessionFilter) (int, error)

func (*Sessions) CreateSession

func (s *Sessions) CreateSession(session *aitm.Session) error

func (*Sessions) DeleteSession

func (s *Sessions) DeleteSession(id string) error

func (*Sessions) GetSession

func (s *Sessions) GetSession(id string) (*aitm.Session, error)

func (*Sessions) ListSessions

func (s *Sessions) ListSessions(f aitm.SessionFilter) ([]*aitm.Session, error)

func (*Sessions) UpdateSession

func (s *Sessions) UpdateSession(session *aitm.Session) error

Jump to

Keyboard shortcuts

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