storage

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Storage

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

Storage provides database connection and common queries. This is a lightweight shared storage implementation for services that need basic database access without the full backend storage layer. It wraps the shared pg storage primitives with application-specific queries.

func New

func New(cfg *config.Config) (*Storage, error)

New creates a new storage instance with database connection. Uses lightweight connection pool settings suitable for frontend/worker services.

func (*Storage) Cleanup

func (s *Storage) Cleanup()

Cleanup closes the database connection pool.

func (*Storage) GetBoardsWithPermissions

func (s *Storage) GetBoardsWithPermissions() (map[string][]string, error)

GetBoardsWithPermissions returns a map of board short names to their allowed email domains. Returns nil for boards without restrictions (public boards). This method is used by the board_access middleware to enforce access control.

func (*Storage) GetRecentlyBlacklistedUsers

func (s *Storage) GetRecentlyBlacklistedUsers(since time.Time) ([]domain.UserId, error)

GetRecentlyBlacklistedUsers fetches all user IDs that were blacklisted after the specified time. This is used by the blacklist cache.

Directories

Path Synopsis
Package pg provides core PostgreSQL database primitives for storage layers.
Package pg provides core PostgreSQL database primitives for storage layers.

Jump to

Keyboard shortcuts

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