Versions in this module Expand all Collapse all v1 v1.0.0 Aug 19, 2025 Changes in this version + type DB interface + BeginTxx func(ctx context.Context, opts *sql.TxOptions) (Tx, error) + Close func() + ConnectContext func(ctx context.Context, driverName, dataSourceName string) (*sqlx.DB, error) + type SQLXWrapper struct + func (w *SQLXWrapper) BeginTxx(ctx context.Context, opts *sql.TxOptions) (Tx, error) + func (w *SQLXWrapper) Close() + func (w *SQLXWrapper) ConnectContext(ctx context.Context, driverName, dataSourceName string) (*sqlx.DB, error) + func (w *SQLXWrapper) SetDB(db *sqlx.DB) + type Storage struct + func NewStorage(timeout time.Duration, driver, host, port, user, password, dbname string, ...) (*Storage, error) + func (s *Storage) Close(_ context.Context) + func (s *Storage) Connect(ctx context.Context) error + func (s *Storage) CreateEvent(ctx context.Context, event *types.Event) (*types.Event, error) + func (s *Storage) DeleteEvent(ctx context.Context, id uuid.UUID) error + func (s *Storage) DeleteOldEvents(ctx context.Context, date time.Time) (int64, error) + func (s *Storage) GetAllUserEvents(ctx context.Context, userID string) ([]*types.Event, error) + func (s *Storage) GetEvent(ctx context.Context, id uuid.UUID) (*types.Event, error) + func (s *Storage) GetEventsForDay(ctx context.Context, date time.Time, userID *string) ([]*types.Event, error) + func (s *Storage) GetEventsForMonth(ctx context.Context, date time.Time, userID *string) ([]*types.Event, error) + func (s *Storage) GetEventsForNotification(ctx context.Context) ([]*types.Event, error) + func (s *Storage) GetEventsForPeriod(ctx context.Context, dateStart, dateEnd time.Time, userID *string) ([]*types.Event, error) + func (s *Storage) GetEventsForWeek(ctx context.Context, date time.Time, userID *string) ([]*types.Event, error) + func (s *Storage) UpdateEvent(ctx context.Context, id uuid.UUID, data *types.EventData) (*types.Event, error) + func (s *Storage) UpdateNotifiedEvents(ctx context.Context, notifiedEvents []uuid.UUID) (int64, error) + type StorageOption func(s *Storage) + func WithDB(db DB) StorageOption + type Tx interface + Commit func() error + ExecContext func(ctx context.Context, query string, args ...interface{}) (sql.Result, error) + GetContext func(ctx context.Context, dest interface{}, query string, args ...interface{}) error + NamedExecContext func(ctx context.Context, query string, arg interface{}) (sql.Result, error) + Rollback func() error + SelectContext func(ctx context.Context, dest interface{}, query string, args ...interface{}) error