Documentation
¶
Index ¶
- Constants
- func AddArtifact(e Execer, artifact models.Artifact) error
- func AddCollaborator(e Execer, c models.Collaborator) error
- func AddEmail(e Execer, email models.Email) error
- func AddFollow(e Execer, follow *models.Follow) error
- func AddInflightSignup(e Execer, signup models.InflightSignup) error
- func AddIssueComment(tx *sql.Tx, c models.IssueComment) (int64, error)
- func AddKnot(e Execer, domain, did string) error
- func AddLabelDefinition(e Execer, l *models.LabelDefinition) (int64, error)
- func AddLabelOp(e Execer, l *models.LabelOp) (int64, error)
- func AddPipeline(e Execer, pipeline models.Pipeline) error
- func AddPipelineStatus(e Execer, status models.PipelineStatus) error
- func AddPublicKey(e Execer, did, name, key, rkey string) error
- func AddPunch(e Execer, punch models.Punch) error
- func AddReaction(e Execer, reactedByDid string, threadAt syntax.ATURI, kind models.ReactionKind, ...) error
- func AddRepo(tx *sql.Tx, repo *models.Repo) error
- func AddSpindle(e Execer, spindle models.Spindle) error
- func AddSpindleMember(e Execer, member models.SpindleMember) error
- func AddStar(e Execer, star *models.Star) error
- func AddString(e Execer, s models.String) error
- func AddTrigger(e Execer, trigger models.Trigger) (int64, error)
- func AddWebhook(e Execer, webhook *models.Webhook) error
- func AddWebhookDelivery(e Execer, delivery *models.WebhookDelivery) error
- func CheckEmailExists(e Execer, did string, email string) (bool, error)
- func CheckEmailExistsAtAll(e Execer, email string) (bool, error)
- func CheckValidVerificationCode(e Execer, did string, email string, code string) (bool, error)
- func CloseIssues(e Execer, filters ...orm.Filter) error
- func ClosePull(e Execer, repoAt syntax.ATURI, pullId int) error
- func CollaboratingIn(e Execer, collaborator string) ([]models.Repo, error)
- func CountNotifications(e Execer, filters ...orm.Filter) (int64, error)
- func CountRepos(e Execer, filters ...orm.Filter) (int64, error)
- func CountStars(e Execer, filters ...orm.Filter) (int64, error)
- func CountStrings(e Execer, filters ...orm.Filter) (int64, error)
- func CreateNotification(e Execer, notification *models.Notification) error
- func DeleteArtifact(e Execer, filters ...orm.Filter) error
- func DeleteCollaborator(e Execer, filters ...orm.Filter) error
- func DeleteEmail(e Execer, did string, email string) error
- func DeleteFollow(e Execer, userDid, subjectDid string) error
- func DeleteFollowByRkey(e Execer, userDid, rkey string) error
- func DeleteInflightSignup(e Execer, email string) error
- func DeleteIssueComments(e Execer, filters ...orm.Filter) error
- func DeleteIssues(tx *sql.Tx, did, rkey string) error
- func DeleteKnot(e Execer, filters ...orm.Filter) error
- func DeleteLabelDefinition(e Execer, filters ...orm.Filter) error
- func DeleteNotification(e Execer, notificationID int64, userDID string) error
- func DeletePublicKey(e Execer, did, name, key string) error
- func DeletePublicKeyByRkey(e Execer, did, rkey string) error
- func DeletePull(e Execer, repoAt syntax.ATURI, pullId int) error
- func DeleteReaction(e Execer, reactedByDid string, threadAt syntax.ATURI, kind models.ReactionKind) error
- func DeleteReactionByRkey(e Execer, reactedByDid string, rkey string) error
- func DeleteRepoLanguages(e Execer, filters ...orm.Filter) error
- func DeleteSpindle(e Execer, filters ...orm.Filter) error
- func DeleteStar(e Execer, did string, subjectAt syntax.ATURI) error
- func DeleteStarByRkey(e Execer, did string, rkey string) error
- func DeleteString(e Execer, filters ...orm.Filter) error
- func DeleteWebhook(e Execer, id int64) error
- func GetAbandonedPulls(e Execer, stackId string) ([]*models.Pull, error)
- func GetActiveWebhooksForRepo(e Execer, repoAt syntax.ATURI) ([]models.Webhook, error)
- func GetAllEmails(e Execer, did string) ([]models.Email, error)
- func GetAllPublicKeys(e Execer) ([]models.PublicKey, error)
- func GetArtifact(e Execer, filters ...orm.Filter) ([]models.Artifact, error)
- func GetBacklinks(e Execer, target syntax.ATURI) ([]models.RichReferenceLink, error)
- func GetBlueskyPosts(e Execer, limit int) ([]models.BskyPost, error)
- func GetCollaborators(e Execer, filters ...orm.Filter) ([]models.Collaborator, error)
- func GetDidForEmail(e Execer, em string) (string, error)
- func GetEmail(e Execer, did string, em string) (models.Email, error)
- func GetEmailForCode(e Execer, inviteCode string) (string, error)
- func GetEmailToDid(e Execer, emails []string, isVerifiedFilter bool) (map[string]string, error)
- func GetFollow(e Execer, userDid, subjectDid string) (*models.Follow, error)
- func GetFollowStatus(e Execer, userDid, subjectDid string) models.FollowStatus
- func GetFollowStatuses(e Execer, userDid string, subjectDids []string) (map[string]models.FollowStatus, error)
- func GetFollowerFollowingCount(e Execer, did string) (models.FollowStats, error)
- func GetFollowerFollowingCounts(e Execer, dids []string) (map[string]models.FollowStats, error)
- func GetFollowers(e Execer, did string) ([]models.Follow, error)
- func GetFollowing(e Execer, did string) ([]models.Follow, error)
- func GetFollows(e Execer, limit int, filters ...orm.Filter) ([]models.Follow, error)
- func GetForkByDid(e Execer, did string, name string) (*models.Repo, error)
- func GetForksByDid(e Execer, did string) ([]models.Repo, error)
- func GetIssue(e Execer, repoAt syntax.ATURI, issueId int) (*models.Issue, error)
- func GetIssueComments(e Execer, filters ...orm.Filter) ([]models.IssueComment, error)
- func GetIssueCount(e Execer, repoAt syntax.ATURI) (models.IssueCount, error)
- func GetIssues(e Execer, filters ...orm.Filter) ([]models.Issue, error)
- func GetIssuesPaginated(e Execer, page pagination.Page, filters ...orm.Filter) ([]models.Issue, error)
- func GetLabelDefinition(e Execer, filters ...orm.Filter) (*models.LabelDefinition, error)
- func GetLabelDefinitions(e Execer, filters ...orm.Filter) ([]models.LabelDefinition, error)
- func GetLabelOps(e Execer, filters ...orm.Filter) ([]models.LabelOp, error)
- func GetLabels(e Execer, filters ...orm.Filter) (map[syntax.ATURI]models.LabelState, error)
- func GetNotificationPreference(e Execer, userDid string) (*models.NotificationPreferences, error)
- func GetNotificationPreferences(e Execer, filters ...orm.Filter) (map[syntax.DID]*models.NotificationPreferences, error)
- func GetNotifications(e Execer, filters ...orm.Filter) ([]*models.Notification, error)
- func GetNotificationsPaginated(e Execer, page pagination.Page, filters ...orm.Filter) ([]*models.Notification, error)
- func GetNotificationsWithEntities(e Execer, page pagination.Page, filters ...orm.Filter) ([]*models.NotificationWithEntity, error)
- func GetPipelineStatuses(e Execer, limit int, filters ...orm.Filter) ([]models.Pipeline, error)
- func GetPipelines(e Execer, filters ...orm.Filter) ([]models.Pipeline, error)
- func GetPrimaryEmail(e Execer, did string) (models.Email, error)
- func GetProfile(e Execer, did string) (*models.Profile, error)
- func GetProfiles(e Execer, filters ...orm.Filter) (map[string]*models.Profile, error)
- func GetPublicKeysForDid(e Execer, did string) ([]models.PublicKey, error)
- func GetPull(e Execer, repoAt syntax.ATURI, pullId int) (*models.Pull, error)
- func GetPullAt(e Execer, repoAt syntax.ATURI, pullId int) (syntax.ATURI, error)
- func GetPullComments(e Execer, filters ...orm.Filter) ([]models.PullComment, error)
- func GetPullCount(e Execer, repoAt syntax.ATURI) (models.PullCount, error)
- func GetPullSubmissions(e Execer, filters ...orm.Filter) (map[syntax.ATURI][]*models.PullSubmission, error)
- func GetPulls(e Execer, filters ...orm.Filter) ([]*models.Pull, error)
- func GetPullsByOwnerDid(e Execer, did, timeframe string) ([]models.Pull, error)
- func GetPullsPaginated(e Execer, page pagination.Page, filters ...orm.Filter) ([]*models.Pull, error)
- func GetPunchcardPreference(e Execer, did string) (models.PunchcardPreference, error)
- func GetReaction(e Execer, reactedByDid string, threadAt syntax.ATURI, kind models.ReactionKind) (*models.Reaction, error)
- func GetReactionCount(e Execer, threadAt syntax.ATURI, kind models.ReactionKind) (int, error)
- func GetReactionMap(e Execer, userLimit int, threadAt syntax.ATURI) (map[models.ReactionKind]models.ReactionDisplayData, error)
- func GetReactionStatus(e Execer, userDid string, threadAt syntax.ATURI, kind models.ReactionKind) bool
- func GetReactionStatusMap(e Execer, userDid string, threadAt syntax.ATURI) map[models.ReactionKind]bool
- func GetReferencesAll(e Execer, filters ...orm.Filter) (map[syntax.ATURI][]syntax.ATURI, error)
- func GetRegistrations(e Execer, filters ...orm.Filter) ([]models.Registration, error)
- func GetRepo(e Execer, filters ...orm.Filter) (*models.Repo, error)
- func GetRepoByAtUri(e Execer, atUri string) (*models.Repo, error)
- func GetRepoLabels(e Execer, filters ...orm.Filter) ([]models.RepoLabel, error)
- func GetRepoLanguages(e Execer, filters ...orm.Filter) ([]models.RepoLanguage, error)
- func GetRepoSource(e Execer, repoAt syntax.ATURI) (string, error)
- func GetRepoSourceRepo(e Execer, repoAt syntax.ATURI) (*models.Repo, error)
- func GetRepoStars(e Execer, limit int, filters ...orm.Filter) ([]models.RepoStar, error)
- func GetRepos(e Execer, limit int, filters ...orm.Filter) ([]models.Repo, error)
- func GetSpindleMembers(e Execer, filters ...orm.Filter) ([]models.SpindleMember, error)
- func GetSpindles(e Execer, filters ...orm.Filter) ([]models.Spindle, error)
- func GetStack(e Execer, stackId string) (models.Stack, error)
- func GetStar(e Execer, did string, subjectAt syntax.ATURI) (*models.Star, error)
- func GetStarCount(e Execer, subjectAt syntax.ATURI) (int, error)
- func GetStarStatus(e Execer, userDid string, subjectAt syntax.ATURI) bool
- func GetStarStatuses(e Execer, userDid string, subjectAts []syntax.ATURI) (map[string]bool, error)
- func GetStrings(e Execer, limit int, filters ...orm.Filter) ([]models.String, error)
- func GetTopStarredReposLastWeek(e Execer) ([]models.Repo, error)
- func GetTotalPipelineStatuses(e Execer, filters ...orm.Filter) (int64, error)
- func GetVanityStat(e Execer, did string, stat models.VanityStatKind) (uint64, error)
- func GetVerificationCodeForEmail(e Execer, did string, email string) (string, error)
- func GetWebhook(e Execer, id int64) (*models.Webhook, error)
- func GetWebhookDeliveries(e Execer, webhookId int64, limit int) ([]models.WebhookDelivery, error)
- func GetWebhooks(e Execer, filters ...orm.Filter) ([]models.Webhook, error)
- func GetWebhooksForRepo(e Execer, repoAt syntax.ATURI) ([]models.Webhook, error)
- func InsertBlueskyPosts(e Execer, posts []models.BskyPost) error
- func InsertRepoLanguages(e Execer, langs []models.RepoLanguage) error
- func MakeEmailPrimary(e Execer, did string, email string) error
- func MakeProfileTimeline(e Execer, forDid string) (*models.ProfileTimeline, error)
- func MakePunchcard(e Execer, filters ...orm.Filter) (*models.Punchcard, error)
- func MakeTimeline(e Execer, limit int, loggedInUserDid string, limitToUsersIsFollowing bool) ([]models.TimelineEvent, error)
- func MarkAllNotificationsRead(e Execer, userDID string) error
- func MarkEmailVerified(e Execer, did string, email string) error
- func MarkNotificationRead(e Execer, notificationID int64, userDID string) error
- func MarkRegistered(e Execer, filters ...orm.Filter) error
- func MergePull(e Execer, repoAt syntax.ATURI, pullId int) error
- func NewLabelApplicationCtx(e Execer, filters ...orm.Filter) (*models.LabelApplicationCtx, error)
- func NewPull(tx *sql.Tx, pull *models.Pull) error
- func NewPullComment(tx *sql.Tx, comment *models.PullComment) (int64, error)
- func NextPullId(e Execer, repoAt syntax.ATURI) (int, error)
- func PutIssue(tx *sql.Tx, issue *models.Issue) error
- func PutRepo(tx *sql.Tx, repo models.Repo) error
- func RemoveRepo(e Execer, did, name string) error
- func RemoveSpindleMember(e Execer, filters ...orm.Filter) error
- func ReopenIssues(e Execer, filters ...orm.Filter) error
- func ReopenPull(e Execer, repoAt syntax.ATURI, pullId int) error
- func ResubmitPull(e Execer, pullAt syntax.ATURI, newRoundNumber int, newPatch string, ...) error
- func SetPullParentChangeId(e Execer, parentChangeId string, filters ...orm.Filter) error
- func SetPullState(e Execer, repoAt syntax.ATURI, pullId int, pullState models.PullState) error
- func SubscribeLabel(e Execer, rl *models.RepoLabel) error
- func UnsubscribeLabel(e Execer, filters ...orm.Filter) error
- func UpdateDescription(e Execer, repoAt, newDescription string) error
- func UpdatePull(e Execer, newPatch, sourceRev string, filters ...orm.Filter) error
- func UpdateRepoLanguages(tx *sql.Tx, repoAt syntax.ATURI, ref string, langs []models.RepoLanguage) error
- func UpdateSpindle(e Execer, repoAt string, spindle *string) error
- func UpdateVerificationCode(e Execer, did string, email string, code string) error
- func UpdateWebhook(e Execer, webhook *models.Webhook) error
- func UpsertProfile(tx *sql.Tx, profile *models.Profile) error
- func UpsertPunchcardPreference(e Execer, did string, hideMine, hideOthers bool) error
- func ValidateProfile(e Execer, profile *models.Profile) error
- func ValidateReferenceLinks(e Execer, refLinks []models.ReferenceLink) ([]syntax.ATURI, error)
- func VerifySpindle(e Execer, filters ...orm.Filter) (int64, error)
- type DB
- type DbWrapper
- type Execer
Constants ¶
const TimeframeMonths = 7
Variables ¶
This section is empty.
Functions ¶
func AddCollaborator ¶
func AddCollaborator(e Execer, c models.Collaborator) error
func AddInflightSignup ¶
func AddInflightSignup(e Execer, signup models.InflightSignup) error
func AddLabelDefinition ¶
func AddLabelDefinition(e Execer, l *models.LabelDefinition) (int64, error)
no updating type for now
func AddPipelineStatus ¶
func AddPipelineStatus(e Execer, status models.PipelineStatus) error
func AddReaction ¶
func AddSpindle ¶
if there is an existing spindle with the same instance, this returns an error
func AddSpindleMember ¶
func AddSpindleMember(e Execer, member models.SpindleMember) error
func AddWebhook ¶
AddWebhook creates a new webhook
func AddWebhookDelivery ¶
func AddWebhookDelivery(e Execer, delivery *models.WebhookDelivery) error
AddWebhookDelivery records a webhook delivery attempt
func CheckValidVerificationCode ¶
func CreateNotification ¶
func CreateNotification(e Execer, notification *models.Notification) error
func DeleteFollowByRkey ¶
Remove a follow
func DeleteNotification ¶
func DeleteReaction ¶
func DeleteReaction(e Execer, reactedByDid string, threadAt syntax.ATURI, kind models.ReactionKind) error
Remove a reaction
func DeleteReactionByRkey ¶
Remove a reaction
func DeleteStarByRkey ¶
Remove a star
func GetActiveWebhooksForRepo ¶
GetActiveWebhooksForRepo returns only active webhooks for a repository
func GetBacklinks ¶
func GetCollaborators ¶
func GetEmailToDid ¶
func GetFollow ¶
Get a follow record
func GetFollowStatus ¶
func GetFollowStatus(e Execer, userDid, subjectDid string) models.FollowStatus
func GetFollowStatuses ¶
func GetFollowerFollowingCount ¶
func GetFollowerFollowingCount(e Execer, did string) (models.FollowStats, error)
func GetFollowerFollowingCounts ¶
func GetFollows ¶
func GetIssueComments ¶
func GetIssuesPaginated ¶
func GetLabelDefinition ¶
helper to get exactly one label def
func GetLabelDefinitions ¶
func GetLabels ¶
get labels for a given list of subject URIs
func GetNotificationPreference ¶
func GetNotificationPreference(e Execer, userDid string) (*models.NotificationPreferences, error)
func GetNotificationPreferences ¶
func GetNotifications ¶
GetNotifications retrieves notifications with filters
func GetNotificationsPaginated ¶
func GetNotificationsPaginated(e Execer, page pagination.Page, filters ...orm.Filter) ([]*models.Notification, error)
GetNotificationsPaginated retrieves notifications with filters and pagination
func GetNotificationsWithEntities ¶
func GetNotificationsWithEntities(e Execer, page pagination.Page, filters ...orm.Filter) ([]*models.NotificationWithEntity, error)
GetNotificationsWithEntities retrieves notifications with their related entities
func GetPipelineStatuses ¶
this is a mega query, but the most useful one: get N pipelines, for each one get the latest status of its N workflows
the pipelines table is aliased to `p` the triggers table is aliased to `t`
func GetProfiles ¶
func GetPublicKeysForDid ¶
func GetPullComments ¶
func GetPullSubmissions ¶
func GetPullSubmissions(e Execer, filters ...orm.Filter) (map[syntax.ATURI][]*models.PullSubmission, error)
mapping from pull -> pull submissions
func GetPullsByOwnerDid ¶
timeframe here is directly passed into the sql query filter, and any timeframe in the past should be negative; e.g.: "-3 months"
func GetPullsPaginated ¶
func GetPunchcardPreference ¶
func GetPunchcardPreference(e Execer, did string) (models.PunchcardPreference, error)
func GetReaction ¶
func GetReaction(e Execer, reactedByDid string, threadAt syntax.ATURI, kind models.ReactionKind) (*models.Reaction, error)
Get a reaction record
func GetReactionCount ¶
func GetReactionMap ¶
func GetReactionMap(e Execer, userLimit int, threadAt syntax.ATURI) (map[models.ReactionKind]models.ReactionDisplayData, error)
func GetReactionStatus ¶
func GetReactionStatusMap ¶
func GetReferencesAll ¶
func GetRegistrations ¶
func GetRepo ¶
helper to get exactly one repo
func GetRepoLabels ¶
func GetRepoLanguages ¶
func GetRepoSourceRepo ¶
func GetRepoStars ¶
GetRepoStars return a list of stars each holding target repository. If there isn't known repo with starred at-uri, those stars will be ignored.
func GetSpindleMembers ¶
func GetStack ¶
change-id parent-change-id
4 w ,-------- z (TOP) 3 z <----',------- y 2 y <-----',------ x 1 x <------' nil (BOT)
`w` is parent of none, so it is the top of the stack
func GetStar ¶
Get a star record
func GetStarStatuses ¶
GetStarStatuses returns a map of repo URIs to star status for a given user
func GetStrings ¶
func GetTopStarredReposLastWeek ¶
GetTopStarredReposLastWeek returns the top 8 most starred repositories from the last week
func GetTotalPipelineStatuses ¶
the pipelines table is aliased to `p` the triggers table is aliased to `t`
func GetVanityStat ¶
func GetVerificationCodeForEmail ¶
func GetWebhook ¶
GetWebhook returns a single webhook by ID
func GetWebhookDeliveries ¶
GetWebhookDeliveries returns recent deliveries for a webhook
func GetWebhooks ¶
GetWebhooks returns all webhooks for a repository
func GetWebhooksForRepo ¶
GetWebhooksForRepo is a convenience function to get all webhooks for a repository
func InsertRepoLanguages ¶
func InsertRepoLanguages(e Execer, langs []models.RepoLanguage) error
func MakeProfileTimeline ¶
func MakeProfileTimeline(e Execer, forDid string) (*models.ProfileTimeline, error)
func MakeTimeline ¶
func MakeTimeline(e Execer, limit int, loggedInUserDid string, limitToUsersIsFollowing bool) ([]models.TimelineEvent, error)
TODO: this gathers heterogenous events from different sources and aggregates them in code; if we did this entirely in sql, we could order and limit and paginate easily
func MarkNotificationRead ¶
func NewLabelApplicationCtx ¶
func ResubmitPull ¶
func SetPullParentChangeId ¶
func SetPullState ¶
func UpdatePull ¶
Only used when stacking to update contents in the event of a rebase (the interdiff should be empty). otherwise submissions are immutable
func UpdateRepoLanguages ¶
func UpdateVerificationCode ¶
func UpdateWebhook ¶
UpdateWebhook updates an existing webhook
func UpsertPunchcardPreference ¶
func ValidateReferenceLinks ¶
ValidateReferenceLinks resolves refLinks to Issue/PR/IssueComment/PullComment ATURIs. It will ignore missing refLinks.
Types ¶
type Execer ¶
type Execer interface {
Query(query string, args ...any) (*sql.Rows, error)
QueryContext(ctx context.Context, query string, args ...any) (*sql.Rows, error)
QueryRow(query string, args ...any) *sql.Row
QueryRowContext(ctx context.Context, query string, args ...any) *sql.Row
Exec(query string, args ...any) (sql.Result, error)
ExecContext(ctx context.Context, query string, args ...any) (sql.Result, error)
Prepare(query string) (*sql.Stmt, error)
PrepareContext(ctx context.Context, query string) (*sql.Stmt, error)
}
Source Files
¶
- artifact.go
- bsky.go
- collaborators.go
- db.go
- email.go
- follow.go
- issues.go
- jetstream.go
- label.go
- language.go
- notifications.go
- pipeline.go
- preferences.go
- profile.go
- pubkeys.go
- pulls.go
- punchcard.go
- reaction.go
- reference.go
- registration.go
- repos.go
- signup.go
- spindle.go
- star.go
- strings.go
- timeline.go
- webhooks.go