Documentation ¶
Overview ¶
Package sqlshortcutstore implements shortcut.Store using an SQL database.
Please see perf/sql/migrations for the database schema used.
Index ¶
- type SQLShortcutStore
- func (s *SQLShortcutStore) DeleteShortcut(ctx context.Context, id string, tx pgx.Tx) error
- func (s *SQLShortcutStore) Get(ctx context.Context, id string) (*shortcut.Shortcut, error)
- func (s *SQLShortcutStore) GetAll(ctx context.Context) (<-chan *shortcut.Shortcut, error)
- func (s *SQLShortcutStore) Insert(ctx context.Context, r io.Reader) (string, error)
- func (s *SQLShortcutStore) InsertShortcut(ctx context.Context, sc *shortcut.Shortcut) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SQLShortcutStore ¶
type SQLShortcutStore struct {
// contains filtered or unexported fields
}
SQLShortcutStore implements the shortcut.Store interface using an SQL database.
func New ¶
func New(db pool.Pool) (*SQLShortcutStore, error)
New returns a new *SQLShortcutStore.
We presume all migrations have been run against db before this function is called.
func (*SQLShortcutStore) DeleteShortcut ¶
func (s *SQLShortcutStore) DeleteShortcut(ctx context.Context, id string, tx pgx.Tx) error
DeleteShortcut implements the shortcut.Store interface.
func (*SQLShortcutStore) InsertShortcut ¶
func (s *SQLShortcutStore) InsertShortcut(ctx context.Context, sc *shortcut.Shortcut) (string, error)
InsertShortcut implements the shortcut.Store interface.
Click to show internal directories.
Click to hide internal directories.