Documentation ¶
Overview ¶
Package sqlalertstore implements alerts.Store using SQL.
Please see perf/sql/migrations for the database schema used.
Index ¶
- type SQLAlertStore
- func (s *SQLAlertStore) Delete(ctx context.Context, id int) error
- func (s *SQLAlertStore) List(ctx context.Context, includeDeleted bool) ([]*alerts.Alert, error)
- func (s *SQLAlertStore) ReplaceAll(ctx context.Context, reqs []*alerts.SaveRequest) error
- func (s *SQLAlertStore) Save(ctx context.Context, req *alerts.SaveRequest) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SQLAlertStore ¶
type SQLAlertStore struct {
// contains filtered or unexported fields
}
SQLAlertStore implements the alerts.Store interface.
func New ¶
func New(db pool.Pool) (*SQLAlertStore, error)
New returns a new *SQLAlertStore.
We presume all migrations have been run against db before this function is called.
func (*SQLAlertStore) Delete ¶
func (s *SQLAlertStore) Delete(ctx context.Context, id int) error
Delete implements the alerts.Store interface.
func (*SQLAlertStore) ReplaceAll ¶
func (s *SQLAlertStore) ReplaceAll(ctx context.Context, reqs []*alerts.SaveRequest) error
ReplaceAll implements the alerts.Store interface. TODO(eduardoyap): Modify to execute one Insert statement, instead of multiple.
func (*SQLAlertStore) Save ¶
func (s *SQLAlertStore) Save(ctx context.Context, req *alerts.SaveRequest) error
Save implements the alerts.Store interface.
Click to show internal directories.
Click to hide internal directories.