data

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2025 License: Apache-2.0 Imports: 7 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 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 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 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 string) error

func OptInGitHubUser

func OptInGitHubUser(slackUserID, username, email 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 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.

Types

This section is empty.

Jump to

Keyboard shortcuts

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