Documentation
¶
Index ¶
- type OptFunc
- type Record
- type SQLite3
- func (s *SQLite3) Close() error
- func (s *SQLite3) DeleteByID(ctx context.Context, id int64) (bool, error)
- func (s *SQLite3) List(ctx context.Context) ([]Record, error)
- func (s *SQLite3) Open(ctx context.Context, filename string) error
- func (s *SQLite3) Save(ctx context.Context, link string, name string, categoryName string) (int64, error)
- type Storage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SQLite3 ¶
type SQLite3 struct {
// contains filtered or unexported fields
}
func NewSQLite3 ¶
func (*SQLite3) Close ¶
Close closes the database. It is important to call before terminating the application.
func (*SQLite3) DeleteByID ¶
DeleteByID deletes the given id from the links table.
type Storage ¶
type Storage interface {
// Save saves the link to database.
Save(ctx context.Context, link string, name string, categoryName string) (int64, error)
// List returns the links in map. The key is number and the value is the link.
List(ctx context.Context) ([]Record, error)
// DeleteByID deletes the links by given IDs.
DeleteByID(ctx context.Context, id int64) (bool, error)
Close() error
}
Click to show internal directories.
Click to hide internal directories.