Documentation
¶
Overview ¶
Package postgres provides a PostgreSQL-backed storage implementation for the application. It includes methods for storing, retrieving, and managing URL records in a PostgreSQL database.
Index ¶
- type Storage
- func (p *Storage) Close() error
- func (p *Storage) DeleteUserURLs(ctx context.Context, ids []string, userID string) error
- func (p *Storage) Get(ctx context.Context, id string) (string, error)
- func (p *Storage) ListLinksByUserID(ctx context.Context, baseURL, userID string) ([]models.URLRecord, error)
- func (p *Storage) Ping() error
- func (p *Storage) Put(ctx context.Context, r models.URLRecord) error
- func (p *Storage) PutBatch(ctx context.Context, rr []models.URLRecord) error
- func (p *Storage) Stats(ctx context.Context) (*models.Stats, error)
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 represents a PostgreSQL-backed storage.
func (*Storage) DeleteUserURLs ¶
DeleteUserURLs deletes multiple URLs associated with a user ID.
func (*Storage) ListLinksByUserID ¶
func (p *Storage) ListLinksByUserID(ctx context.Context, baseURL, userID string) ([]models.URLRecord, error)
ListLinksByUserID lists all URLs associated with a user ID.
Click to show internal directories.
Click to hide internal directories.