A barebone blog aggregator in Go
Made in the context of the Boot.dev class: Build a Blog Aggregator in Go
-
Make sure you have Postgresql and Go installed.
-
Install
gatorby executinggo install github.com/Lauloque/gator@latest -
Make sure you have a running postgresql server, then setup a config file, .gatorconfig.json in your home directory. That file should contain the url to your postgresql server. Example:
{ "db_url": "postgres://username:@localhost:5432/database?sslmode=disable" }Global usage: gator <command> [arguments...]
register [name]- Register a new userlogin [name]- Log in as an existing userusers- List all users
addfeed [feed name] [feed url]- Add a new feed to the databasefeeds- Display feeds that have been added to gatoragg [duration]- Aggregate added feeds at the given interval duration eg: '1s', '1m', '1h' etc
follow [feed url]- Follow a feed already in the databasefollows- Display feeds that the current user is followingunfollow [feed url]- Stop following a feedbrowse [number]- Display[number]most recent posts from followed feeds
reset- Delete all users from database