https://github.com/bbkane/taggedmarks2
Play with different SQL libraries in a CLI bookmarks app
https://github.com/bbkane/taggedmarks2
Last synced: 4 months ago
JSON representation
Play with different SQL libraries in a CLI bookmarks app
- Host: GitHub
- URL: https://github.com/bbkane/taggedmarks2
- Owner: bbkane
- Created: 2023-01-28T14:54:48.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-03-02T04:06:32.000Z (over 3 years ago)
- Last Synced: 2025-11-12T15:34:43.959Z (8 months ago)
- Language: Go
- Size: 43.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
A small CLI to save bookmarks to SQLite. I want to use it to experiment with different SQL libraries. All SQL libraries should be used to implement `TaggedmarkService` , which the CLI app instantiates and uses.
# WTFDial Blog Notes
- https://www.gobeyond.dev/packages-as-layers/
- https://github.com/benbjohnson/wtf
Application types (really interfaces) in their own package - root package that other types depend on
```go
type DialService interface {
FindDialByID(ctx context.Context, id int) (*Dial, error)
FindDials(ctx context.Context, filter DialFilter) ([]*Dial, int, error)
CreateDial(ctx context.Context, dial *Dial) error
UpdateDial(ctx context.Context, id int, upd DialUpdate) (*Dial, error)
DeleteDial(ctx context.Context, id int) error
}
```
The `wtf` package implements these servicces as interfaces. The `sqlite` package implemtents these interface. In `wtf`, the main struct instantiates `sqlite`'s implementation of the interfaces, then attaches them to `http`'s struct, then calls start on the http server. The `http` package *also* implements `wtf`'s interface as a client (by making requests to the server).
The cmd/wtfd package instantiates an HTTP server (which does *NOT* fulfil the interfaces, but contains them) and shoves the `SQLite` implementation into it.
# Questions
- should my Tag struct have a reference to Taggedmark?
# CLI
```bash
taggedmarks
taggedmark
create --url url --tag a --tag b
read --url url # or --id id
delete --url url # or --id id
list --url --tag a
import --type firefoxJSON --path bookmarks.json
tag # Let's ignore this for now :)
rename --from old --from old2 --to new
delete --name name
```