data

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 28, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package data provides functions to manage persistent data storage. It is entirely inefficient and should be replaced with a proper solution.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddBitbucketUser

func AddBitbucketUser(accountID, email string) error

AddBitbucketUser saves a 2-way mapping between a Bitbucket user's account ID and email address.

func AddGitHubUser

func AddGitHubUser(username, email string) error

AddBitbucketUser saves a 2-way mapping between a GitHub user's username and email address.

func AddSlackUser

func AddSlackUser(userID, email string) error

AddBitbucketUser saves a 2-way mapping between a Slack user's user ID and email address.

func BitbucketUserEmailByID

func BitbucketUserEmailByID(accountID string) (string, error)

BitbucketUserEmailByID returns a Bitbucket user's email based on their account ID. Returns an empty string if the user is not found.

func BitbucketUserIDByEmail

func BitbucketUserIDByEmail(email string) (string, error)

BitbucketUserIDByEmail returns a Bitbucket user's account ID based on their email. Returns an empty string if the user is not found.

func DeleteBitbucketPR added in v0.2.0

func DeleteBitbucketPR(url string) error

DeleteBitbucketPR deletes the snapshot of a Bitbucket pull request when it becomes obsolete (i.e. when the PR is merged, closed, or marked as a draft).

func DeleteReminder added in v0.5.0

func DeleteReminder(userID string) error

func DeleteSlackBotIDs added in v0.4.0

func DeleteSlackBotIDs(botID string) error

func DeleteURLAndIDMapping added in v0.2.0

func DeleteURLAndIDMapping(key string) error

DeleteURLAndIDMapping deletes the 2-way mapping between PR URLs and chat channel and thread IDs when they become obsolete (i.e. when the PR is merged, closed, or marked as a draft).

func GetSlackBotUserID added in v0.4.0

func GetSlackBotUserID(botID string) (string, error)

func GitHubUserEmailByID

func GitHubUserEmailByID(username string) (string, error)

GitHubUserEmailByID returns a GitHub user's email based on their username. Returns an empty string if the user is not found.

func GitHubUserIDByEmail

func GitHubUserIDByEmail(email string) (string, error)

GitHubUserIDByEmail returns a GitHub user's username based on their email. Returns an empty string if the user is not found.

func IsOptedIn

func IsOptedIn(email string) (bool, error)

func ListReminders added in v0.5.0

func ListReminders() (map[string]string, error)

func LoadBitbucketPR added in v0.2.0

func LoadBitbucketPR(url string) (any, error)

LoadBitbucketPR loads a snapshot of a Bitbucket pull request. This is used to detect changes in the pull request over time.

func MapURLAndID added in v0.2.0

func MapURLAndID(url, id string) error

MapURLAndID saves a 2-way mapping between a PR URL and its dedicated chat channel or thread IDs.

func OptInBitbucketUser

func OptInBitbucketUser(slackUserID, accountID, email, linkID string) error

func OptInGitHubUser

func OptInGitHubUser(slackUserID, username, email, linkID string) error

func OptOut

func OptOut(email string) error

func RemoveBitbucketUser

func RemoveBitbucketUser(email string) error

RemoveBitbucketUser forgets a Bitbucket user's account ID and email.

func RemoveGitHubUser

func RemoveGitHubUser(email string) error

RemoveGitHubUser forgets a GitHub user's username and email.

func RemoveSlackUser

func RemoveSlackUser(email string) error

RemoveSlackUser forgets a Slack user's user ID and email.

func SetReminder added in v0.5.0

func SetReminder(userID, kitchenTime, tz string) error

func SetSlackBotUserID added in v0.4.0

func SetSlackBotUserID(botID, userID string) error

func SlackUserEmailByID

func SlackUserEmailByID(userID string) (string, error)

SlackUserEmailByID returns a Slack user's email based on their user ID. Returns an empty string if the user is not found.

func SlackUserIDByEmail

func SlackUserIDByEmail(email string) (string, error)

SlackUserIDByEmail returns a Slack user's user ID based on their email. Returns an empty string if the user is not found.

func StoreBitbucketPR added in v0.2.0

func StoreBitbucketPR(url string, pr any) error

StoreBitbucketPR saves a snapshot of a Bitbucket pull request. This is used to detect changes in the pull request over time.

func SwitchURLAndID added in v0.2.0

func SwitchURLAndID(key string) (string, error)

SwitchURLAndID converts a PR URL to its mapped chat channel or thread IDs, and vice versa.

func UserLinkID added in v0.5.0

func UserLinkID(email string) (string, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL