Documentation ¶
Overview ¶
Package shortcut handles storing and retrieving shortcuts.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IDFromKeys ¶
IDFromKeys returns a unique ID for the set of keys found in the given Shortcut.
Types ¶
type Shortcut ¶
type Shortcut struct {
Keys []string `json:"keys"`
}
Shortcut is a list of Trace ids, it is used in the Store interface.
type Store ¶
type Store interface { // Insert adds the shortcut content into the database. The id of the // shortcut is returned. Insert(ctx context.Context, r io.Reader) (string, error) // InsertShortcut adds the shortcut content into the database. The id of the // shortcut is returned. InsertShortcut(ctx context.Context, shortcut *Shortcut) (string, error) // Get retrieves a parsed shortcut for the given id. Get(ctx context.Context, id string) (*Shortcut, error) // GetAll returns a channel that provides all the Shortcuts stored. This is // used to migrate between backends. GetAll(ctx context.Context) (<-chan *Shortcut, error) // DeleteShortcut deletes the shortcut from the table. Use with caution. DeleteShortcut(ctx context.Context, id string, tx pgx.Tx) error }
Store is an interface for things that persists Shortcuts.
Directories ¶
Path | Synopsis |
---|---|
Package shortcuttest has common code for tests of implementations of shortcut.Store.
|
Package shortcuttest has common code for tests of implementations of shortcut.Store. |
Package sqlshortcutstore implements shortcut.Store using an SQL database.
|
Package sqlshortcutstore implements shortcut.Store using an SQL database. |
Click to show internal directories.
Click to hide internal directories.