gator is a RSS aggregation CLI built with Go and Postgres.
- Go (for building/installing the CLI)
- Postgres (for storage)
Use go install to install the CLI binary:
go install github.com/glebson1988/gator@latestThis installs the gator binary into your $GOBIN (or $GOPATH/bin).
Create a config file at ~/.gatorconfig.json:
{
"db_url": "postgres://username:password@localhost:5432/gator?sslmode=disable",
"current_user_name": "alice"
}Ensure your database exists and has the schema applied. The schema lives in sql/schema.
If you use goose:
go install github.com/pressly/goose/v3/cmd/goose@latest
goose -dir sql/schema postgres "$DATABASE_URL" upIf you change SQL in sql/queries, regenerate the query code:
go install github.com/sqlc-dev/sqlc/cmd/sqlc@latest
sqlc generateOnce installed, use the gator binary:
gator register <name>
gator login <name>
gator addfeed <name> <url>
gator follow <url>
gator following
gator unfollow <url>
gator feeds
gator browse
gator agg <interval>
gator resetNotes:
registercreates a user.loginsets the active user in the config file.addfeedcreates a feed and automatically follows it.followsubscribes the current user to a feed by URL.aggfetches and stores posts on a schedule, e.g.gator agg 10s.resetclears all users and related data.
For local development, you can run:
go run . <command> [args...]For production usage, prefer the compiled gator binary from go install or go build.