Documentation ¶
Overview ¶
Package persistence contains methods to store and retrieve content from Amazon DynamoDB.
Index ¶
- func GetAllUsers(client *dynamodb.DynamoDB) (users []structs.User, err error)
- func GetRequestsSince(threshold int64, client *dynamodb.DynamoDB) (requests []structs.Request, err error)
- func IsUserAdmin(userID int, client *dynamodb.DynamoDB) (isAdmin bool, err error)
- func PutRequest(userID int, url string, client *dynamodb.DynamoDB) error
- func PutUser(userID int, client *dynamodb.DynamoDB) error
- func UpdateUserBlockStatus(userID int, hasBlockedBot bool, client *dynamodb.DynamoDB) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAllUsers ¶
GetAllUsers returns all the users that didn't block the bot.
func GetRequestsSince ¶
func GetRequestsSince(threshold int64, client *dynamodb.DynamoDB) (requests []structs.Request, err error)
GetRequestsSince returns the request that happened after a certain threshold. The threshold is given in Unix timestamp format.
func IsUserAdmin ¶
IsUserAdmin returns true if the user's IsAdmin field is true.
func PutRequest ¶
PutRequest saves a request on DynamoDB.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.