sqlitemeta

package
v0.0.1-rc Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CurrentSchemaVersion

func CurrentSchemaVersion() int

CurrentSchemaVersion is the PRAGMA user_version / app-expected value for this binary.

Types

type Store

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

Store is a local meta database with a single-writer queue and a read pool.

func Open

func Open(ctx context.Context, dsn string, log zerolog.Logger) (*Store, error)

Open opens the meta database, runs migrations, and starts the writer loop.

func (*Store) AdminStorageSnapshot

func (s *Store) AdminStorageSnapshot(ctx context.Context) (storage.AdminStorageSnapshot, error)

AdminStorageSnapshot returns audit row count and on-disk bytes for the meta database.

func (*Store) AnalyzeStatsTables

func (s *Store) AnalyzeStatsTables(ctx context.Context) error

AnalyzeStatsTables refreshes sqlite_stat1 for tables used by the admin storage snapshot.

func (*Store) Close

func (s *Store) Close() error

Close stops the writer and closes the database.

func (*Store) CountAuditLog

func (s *Store) CountAuditLog(ctx context.Context, query storage.AuditQuery) (int64, error)

func (*Store) CountWSConnectionSessions

func (s *Store) CountWSConnectionSessions(ctx context.Context) (int64, error)

func (*Store) GetWSConnectionSessionByID

func (s *Store) GetWSConnectionSessionByID(ctx context.Context, id int64) (*storage.WSConnectionSession, error)

func (*Store) HasAuditDuplicate

func (s *Store) HasAuditDuplicate(ctx context.Context, e storage.AuditEntry) (bool, error)

func (*Store) HasWSConnectionSession

func (s *Store) HasWSConnectionSession(ctx context.Context, connID string, startedUnix int64) (bool, error)

func (*Store) ListDistinctAuditKinds

func (s *Store) ListDistinctAuditKinds(ctx context.Context, scanLimit int) ([]int, error)

func (*Store) PurgeAuditLog

func (s *Store) PurgeAuditLog(ctx context.Context, olderThanUnix int64) (int64, error)

func (*Store) PurgeRelayMetricBucketsBefore

func (s *Store) PurgeRelayMetricBucketsBefore(ctx context.Context, cutoffStartUnixExclusive int64) (int64, error)

func (*Store) PurgeWSConnectionSessionsBefore

func (s *Store) PurgeWSConnectionSessionsBefore(ctx context.Context, olderThanUnix int64) (int64, error)

func (*Store) QueryAuditLog

func (s *Store) QueryAuditLog(ctx context.Context, query storage.AuditQuery) ([]storage.AuditEntry, error)

func (*Store) QueryConfigChangelog

func (s *Store) QueryConfigChangelog(ctx context.Context, limit int) ([]storage.ConfigChange, error)

func (*Store) QueryRelayMetricBuckets

func (s *Store) QueryRelayMetricBuckets(ctx context.Context, q storage.RelayMetricBucketQuery) ([]storage.RelayMetricBucket, error)

func (*Store) QueryWSConnectionSessions

func (s *Store) QueryWSConnectionSessions(ctx context.Context, q storage.WSConnectionSessionQuery) ([]storage.WSConnectionSession, error)

func (*Store) SaveAuditEntry

func (s *Store) SaveAuditEntry(ctx context.Context, e storage.AuditEntry) error

func (*Store) SaveConfigChange

func (s *Store) SaveConfigChange(ctx context.Context, c storage.ConfigChange) error

func (*Store) SaveWSConnectionSession

func (s *Store) SaveWSConnectionSession(ctx context.Context, e storage.WSConnectionSession) (int64, error)

func (*Store) UpsertRelayMetricBucket

func (s *Store) UpsertRelayMetricBucket(ctx context.Context, b storage.RelayMetricBucket) error

Jump to

Keyboard shortcuts

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