sqlalertstore

package
v0.0.0-...-4448a72 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2024 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Overview

Package sqlalertstore implements alerts.Store using SQL.

Please see perf/sql/migrations for the database schema used.

Index

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) List

func (s *SQLAlertStore) List(ctx context.Context, includeDeleted bool) ([]*alerts.Alert, error)

List 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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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