package
0.0.0-20241126203643-941fea763649
Repository: https://github.com/seanhuebl/blog_aggregator.git
Documentation: pkg.go.dev
# Functions
HandlerAddFeed adds a new feed and subscribes the current user to it.
HandlerAgg periodically scrapes feeds based on a provided interval.
HandlerBrowse retrieves and displays posts from feeds that the current user follows.
HandlerFeeds retrieves and prints all feeds in the database.
HandlerFollow subscribes the current user to an existing feed by its URL.
HandlerFollowing lists all feeds that the current user is following.
HandlerGetUsers retrieves and prints all users in the database.
HandlerLogin validates the provided username and sets it as the current user.
HandlerRegister creates a new user and sets them as the current user.
HandlerReset deletes all users in the database.
HandlerUnfollow unsubscribes the current user from a feed by its URL.
MiddlewareLoggedIn ensures that a user is logged in before executing a command.
Read reads the configuration file and parses it into a Config struct.
ScrapeFeeds fetches the next feed to be processed and stores its posts in the database.
# Structs
Command represents a user-specified command and its arguments.
Commands stores a registry of available commands and their associated handlers.
Config represents the application's configuration, including database URL and the current user.
State holds the application state, including the database and configuration.