infrastructure

package
v0.0.0-...-4d6988e Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetStats

func GetStats() map[string]interface{}

func InitializePostgresShards

func InitializePostgresShards(connections []string) error

func ResolveShard

func ResolveShard(userID string, shardCount int) int

Types

type PostgresStorage

type PostgresStorage struct {
	Db *sql.DB
}

func GetPostgresForUser

func GetPostgresForUser(userID string) *PostgresStorage

func (*PostgresStorage) Connect

func (p *PostgresStorage) Connect(connectionString string) error

Connect establishes connection to PostgreSQL

func (*PostgresStorage) DecrementUserFileStats

func (p *PostgresStorage) DecrementUserFileStats(userID string) error

func (*PostgresStorage) DeleteAllFilesForUser

func (p *PostgresStorage) DeleteAllFilesForUser(userID string) int

func (*PostgresStorage) DeleteFileMetadata

func (p *PostgresStorage) DeleteFileMetadata(fileID, userID string) bool

func (*PostgresStorage) DeleteUserFileStats

func (p *PostgresStorage) DeleteUserFileStats(userID string) error

func (*PostgresStorage) GetFileMetadata

func (p *PostgresStorage) GetFileMetadata(fileID string) (models.FileMetadata, bool)

func (*PostgresStorage) GetUserFileCount

func (p *PostgresStorage) GetUserFileCount(userID string) (int64, error)

GetUserFileCount counts total files for a user

func (*PostgresStorage) GetUserFileMetadata

func (p *PostgresStorage) GetUserFileMetadata(userID string) []models.FileMetadata

func (*PostgresStorage) GetUserFileMetadataPage

func (p *PostgresStorage) GetUserFileMetadataPage(userID string, limit, offset int) ([]models.FileMetadata, error)

GetUserFileMetadataPage returns a page of files for a user

func (*PostgresStorage) GetUserFileStats

func (p *PostgresStorage) GetUserFileStats(userID string) (int, error)

func (*PostgresStorage) IncrementUserFileStats

func (p *PostgresStorage) IncrementUserFileStats(userID string) error

func (*PostgresStorage) SaveFileMetadata

func (p *PostgresStorage) SaveFileMetadata(metadata models.FileMetadata) error

func (*PostgresStorage) UpdateFileScanStatus

func (p *PostgresStorage) UpdateFileScanStatus(
	fileID, status string,
	scannedAt time.Time,
) error

type Resolver

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

type ShardedPostgres

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

Jump to

Keyboard shortcuts

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