Documentation
¶
Overview ¶
Package store owns the database schema, GORM models, repositories, and the goose-driven migration runner. Callers depend on small interfaces declared where they consume the store (handler packages); only this package needs to know about GORM.
Index ¶
- Variables
- func MigrateDown(ctx context.Context, db *gorm.DB) error
- func MigrateStatus(ctx context.Context, db *gorm.DB) (string, error)
- func MigrateUp(ctx context.Context, db *gorm.DB) error
- func NewTestDB(t *testing.T) *gorm.DB
- func Open(url string) (*gorm.DB, error)
- func RawCreateForTest(db *gorm.DB, pr PullRequest) error
- func SQLDB(db *gorm.DB) (*sql.DB, error)
- type AccessInvite
- type AccessInvites
- type AccessToken
- type AccessTokens
- func (r *AccessTokens) Delete(ctx context.Context, id string) error
- func (r *AccessTokens) Find(ctx context.Context, id string) (AccessToken, error)
- func (r *AccessTokens) List(ctx context.Context) ([]AccessToken, error)
- func (r *AccessTokens) TouchLastUsed(ctx context.Context, id string, usedAt time.Time) error
- type CodeReview
- type CodeReviews
- func (r *CodeReviews) ActiveForUser(ctx context.Context, repository string, prNumber int, slackUserID string) (CodeReview, error)
- func (r *CodeReviews) Finish(ctx context.Context, repository string, prNumber int) error
- func (r *CodeReviews) GetActive(ctx context.Context, repository string, prNumber int) (CodeReview, error)
- func (r *CodeReviews) Reviewers(ctx context.Context, repository string, prNumber int) ([]CodeReview, error)
- func (r *CodeReviews) Start(ctx context.Context, repository string, prNumber int, ...) error
- type FeedClaim
- type FeedDeliveries
- type FeedDelivery
- type FeedPullRequest
- type FeedPullRequests
- func (r *FeedPullRequests) ChangedSince(ctx context.Context, repositories []string, since time.Time) ([]FeedPullRequest, error)
- func (r *FeedPullRequests) Delete(ctx context.Context, repository string, number int) error
- func (r *FeedPullRequests) DeleteAll(ctx context.Context) (int, error)
- func (r *FeedPullRequests) DeleteRepositories(ctx context.Context, repositories []string) (int, error)
- func (r *FeedPullRequests) Repositories(ctx context.Context) ([]string, error)
- func (r *FeedPullRequests) Upsert(ctx context.Context, pullRequest FeedPullRequest) error
- type FeedSubscription
- type FeedSubscriptionBatch
- type FeedSubscriptions
- func (r *FeedSubscriptions) Add(ctx context.Context, batch FeedSubscriptionBatch) (int, error)
- func (r *FeedSubscriptions) Delete(ctx context.Context, tokenID string, id int64) (FeedSubscription, error)
- func (r *FeedSubscriptions) DeleteRepositories(ctx context.Context, repositories []string) (int, error)
- func (r *FeedSubscriptions) List(ctx context.Context, tokenID string) ([]FeedSubscription, error)
- func (r *FeedSubscriptions) Repositories(ctx context.Context) ([]string, error)
- type Message
- type PullRequest
- type PullRequests
- func (r *PullRequests) AddMessage(ctx context.Context, repository string, prNumber int, ...) error
- func (r *PullRequests) Delete(ctx context.Context, repository string, prNumber int) error
- func (r *PullRequests) DeleteStaleBefore(ctx context.Context, cutoff time.Time) (int64, error)
- func (r *PullRequests) FindStuck(ctx context.Context, cutoff time.Time) ([]PullRequest, error)
- func (r *PullRequests) ListOpen(ctx context.Context) ([]PullRequest, error)
- func (r *PullRequests) ListOpenWithMessages(ctx context.Context) ([]PullRequest, error)
- func (r *PullRequests) MarkClosed(ctx context.Context, repository string, prNumber int) error
- func (r *PullRequests) Messages(ctx context.Context, repository string, prNumber int) ([]Message, error)
- func (r *PullRequests) MoveMessage(ctx context.Context, repository string, prNumber int, ...) error
- func (r *PullRequests) RemoveMessage(ctx context.Context, repository string, prNumber int, channel string) error
- func (r *PullRequests) Touch(ctx context.Context, repository string, prNumber int) error
- type Reactions
- type RepoMapping
- type ScheduledItem
- type ScheduledNotification
- type ScheduledNotifications
- func (r *ScheduledNotifications) AnnouncedSince(ctx context.Context, cutoff time.Time) ([]ScheduledItem, error)
- func (r *ScheduledNotifications) Enqueue(ctx context.Context, item ScheduledItem) error
- func (r *ScheduledNotifications) MarkSent(ctx context.Context, ids []uint, sentAt time.Time) error
- func (r *ScheduledNotifications) Pending(ctx context.Context) ([]ScheduledItem, error)
- type Target
Constants ¶
This section is empty.
Variables ¶
var ErrActiveReviewExists = errors.New("store: active code review exists")
ErrActiveReviewExists is returned by Start when the same user already has an active review on the PR — the partial unique index rejected the insert. Callers surface the conflict UX ("already reviewing") instead of a 500.
var ErrInviteUsed = errors.New("store: access invite already used")
ErrInviteUsed is returned by Redeem when the invite was already redeemed.
var ErrNotFound = routingdomain.ErrNotFound
ErrNotFound aliases the routing domain sentinel so all existing callers keep the same value.
Functions ¶
func MigrateDown ¶
MigrateDown rolls back the most recent migration.
func MigrateStatus ¶
MigrateStatus returns a human-readable list of each migration and whether it has been applied.
func NewTestDB ¶
NewTestDB returns a *gorm.DB backed by a fresh on-disk SQLite database inside t.TempDir, with all migrations applied. The database is closed and removed automatically when the test completes.
We use an on-disk file rather than `:memory:` because the goose-sqlite driver expects a stable database name to record migration state, and multiple in-memory connections in the same process are not always shared.
func Open ¶
Open opens a SQLite database for production use. The url accepts either a raw file path or the "file:..." DSN form used in our config defaults.
GORM's logger is silenced for "record not found" because we treat ErrNotFound as a normal return value, not a warning condition.
func RawCreateForTest ¶
func RawCreateForTest(db *gorm.DB, pr PullRequest) error
RawCreateForTest inserts a pull_requests row preserving the caller's CreatedAt/UpdatedAt/ClosedAt, bypassing GORM's autoCreate/UpdateTime. Used by tests that need to seed PRs with a controlled age and open/closed state. A zero CreatedAt defaults to UpdatedAt.
Types ¶
type AccessInvite ¶ added in v0.29.0
type AccessInvite struct {
ID string `gorm:"primaryKey"`
User string `gorm:"column:user;not null"`
SecretHash string `gorm:"column:secret_hash;not null"`
ExpiresAt time.Time `gorm:"column:expires_at;not null"`
UsedAt *time.Time `gorm:"column:used_at"`
CreatedAt time.Time `gorm:"column:created_at;not null"`
}
AccessInvite is a one-time invite; UsedAt is set when it is redeemed.
func (AccessInvite) TableName ¶ added in v0.29.0
func (AccessInvite) TableName() string
TableName pins the table name.
type AccessInvites ¶ added in v0.29.0
type AccessInvites struct {
// contains filtered or unexported fields
}
AccessInvites persists one-time invites.
func NewAccessInvites ¶ added in v0.29.0
func NewAccessInvites(db *gorm.DB) *AccessInvites
NewAccessInvites constructs an AccessInvites repository bound to db.
func (*AccessInvites) Create ¶ added in v0.29.0
func (r *AccessInvites) Create(ctx context.Context, invite AccessInvite) error
Create inserts an invite.
func (*AccessInvites) Find ¶ added in v0.29.0
func (r *AccessInvites) Find(ctx context.Context, id string) (AccessInvite, error)
Find returns the invite, or ErrNotFound.
func (*AccessInvites) Redeem ¶ added in v0.29.0
func (r *AccessInvites) Redeem(ctx context.Context, inviteID string, token AccessToken) error
Redeem marks the invite used and inserts the token in one transaction, or returns ErrInviteUsed when the invite is unknown or already used.
type AccessToken ¶ added in v0.29.0
type AccessToken struct {
ID string `gorm:"primaryKey"`
User string `gorm:"column:user;not null"`
SecretHash string `gorm:"column:secret_hash;not null"`
CreatedAt time.Time `gorm:"column:created_at;not null"`
LastUsedAt *time.Time `gorm:"column:last_used_at"`
}
AccessToken is a long-lived agent token stored as a hash.
func (AccessToken) TableName ¶ added in v0.29.0
func (AccessToken) TableName() string
TableName pins the table name.
type AccessTokens ¶ added in v0.29.0
type AccessTokens struct {
// contains filtered or unexported fields
}
AccessTokens persists agent tokens.
func NewAccessTokens ¶ added in v0.29.0
func NewAccessTokens(db *gorm.DB) *AccessTokens
NewAccessTokens constructs an AccessTokens repository bound to db.
func (*AccessTokens) Delete ¶ added in v0.29.0
func (r *AccessTokens) Delete(ctx context.Context, id string) error
Delete removes the token, or returns ErrNotFound.
func (*AccessTokens) Find ¶ added in v0.29.0
func (r *AccessTokens) Find(ctx context.Context, id string) (AccessToken, error)
Find returns the token, or ErrNotFound.
func (*AccessTokens) List ¶ added in v0.29.0
func (r *AccessTokens) List(ctx context.Context) ([]AccessToken, error)
List returns all tokens ordered by creation time.
func (*AccessTokens) TouchLastUsed ¶ added in v0.29.0
TouchLastUsed records when the token was last used.
type CodeReview ¶
type CodeReview struct {
ID uint `gorm:"primaryKey"`
PullRequestID uint `gorm:"column:pull_request_id;not null"`
SlackUserID string `gorm:"column:slack_user_id;not null"`
SlackUserName string `gorm:"column:slack_user_name"`
StartedAt time.Time `gorm:"column:started_at;not null"`
FinishedAt *time.Time `gorm:"column:finished_at"`
}
CodeReview is one review "session" for a PR: who started reviewing it and when, with FinishedAt nil while the review is in progress and set once the reviewer's GitHub review lands. It hangs off a PullRequest (cascade-deleted with it) and a partial unique index enforces at most one active (FinishedAt IS NULL) review per PR — finished rows accumulate as history.
type CodeReviews ¶
type CodeReviews struct {
// contains filtered or unexported fields
}
CodeReviews persists per-PR review sessions and enforces at most one active review per (PR, user); multiple distinct users may review a PR concurrently. A review is identified to callers by its PR's natural key (repository, prNumber); the surrogate pull_request_id is resolved internally.
func NewCodeReviews ¶
func NewCodeReviews(db *gorm.DB) *CodeReviews
NewCodeReviews constructs a CodeReviews repository bound to db.
func (*CodeReviews) ActiveForUser ¶
func (r *CodeReviews) ActiveForUser(ctx context.Context, repository string, prNumber int, slackUserID string) (CodeReview, error)
ActiveForUser returns the user's active (unfinished) review on the PR, or ErrNotFound when that user has no review in progress here. It is the app-level guard the click handler checks before Start; the DB's partial unique index on (pull_request_id, slack_user_id) is the race-safe backstop.
func (*CodeReviews) Finish ¶
Finish marks the PR's active review finished. It is idempotent: no active review (or an untracked PR) is a no-op, mirroring MarkClosed.
func (*CodeReviews) GetActive ¶
func (r *CodeReviews) GetActive(ctx context.Context, repository string, prNumber int) (CodeReview, error)
GetActive returns the PR's active (unfinished) review, or ErrNotFound when the PR is untracked or has no review in progress.
func (*CodeReviews) Reviewers ¶
func (r *CodeReviews) Reviewers(ctx context.Context, repository string, prNumber int) ([]CodeReview, error)
Reviewers returns all code-review sessions for the PR ordered by started_at ascending (earliest first). An untracked PR or a PR with no reviews returns an empty slice and nil error.
func (*CodeReviews) Start ¶
func (r *CodeReviews) Start(ctx context.Context, repository string, prNumber int, slackUserID, slackUserName string) error
Start opens a review on the PR for the given Slack user. It returns ErrNotFound when the PR is not tracked, and ErrActiveReviewExists when the PR already has an active review — the DB's partial unique index is the source of truth, so two near-simultaneous Starts can't both win.
type FeedClaim ¶ added in v0.29.0
FeedClaim asks for the pull requests a token has not received yet.
type FeedDeliveries ¶ added in v0.29.0
type FeedDeliveries struct {
// contains filtered or unexported fields
}
FeedDeliveries records which pull requests each token has received.
func NewFeedDeliveries ¶ added in v0.29.0
func NewFeedDeliveries(db *gorm.DB) *FeedDeliveries
NewFeedDeliveries constructs a FeedDeliveries repository bound to db.
func (*FeedDeliveries) Claim ¶ added in v0.29.0
func (r *FeedDeliveries) Claim(ctx context.Context, claim FeedClaim) ([]FeedPullRequest, error)
Claim writes first so SQLite never upgrades a read lock, which fails at once with SQLITE_BUSY.
type FeedDelivery ¶ added in v0.29.0
type FeedDelivery struct {
TokenID string `gorm:"column:token_id;primaryKey"`
Repository string `gorm:"column:repository;primaryKey"`
Number int `gorm:"column:number;primaryKey"`
DeliveredAt time.Time `gorm:"column:delivered_at;not null;autoCreateTime:false"`
}
FeedDelivery records that a token already received a pull request.
func (FeedDelivery) TableName ¶ added in v0.29.0
func (FeedDelivery) TableName() string
TableName pins the table name.
type FeedPullRequest ¶ added in v0.29.0
type FeedPullRequest struct {
Repository string `gorm:"column:repository;primaryKey"`
Number int `gorm:"column:number;primaryKey"`
Title string `gorm:"column:title"`
Description string `gorm:"column:description"`
URL string `gorm:"column:url"`
AuthorID string `gorm:"column:author_id"`
SourceBranch string `gorm:"column:source_branch"`
TargetBranch string `gorm:"column:target_branch"`
HeadSHA string `gorm:"column:head_sha;not null"`
CreatedAt *time.Time `gorm:"column:created_at;autoCreateTime:false"`
UpdatedAt time.Time `gorm:"column:updated_at;not null;autoUpdateTime:false"`
}
FeedPullRequest is the latest known state of an open pull request.
func (FeedPullRequest) TableName ¶ added in v0.29.0
func (FeedPullRequest) TableName() string
TableName pins the table name.
type FeedPullRequests ¶ added in v0.29.0
type FeedPullRequests struct {
// contains filtered or unexported fields
}
FeedPullRequests persists the latest state of open pull requests.
func NewFeedPullRequests ¶ added in v0.29.0
func NewFeedPullRequests(db *gorm.DB) *FeedPullRequests
NewFeedPullRequests constructs a FeedPullRequests repository bound to db.
func (*FeedPullRequests) ChangedSince ¶ added in v0.29.0
func (r *FeedPullRequests) ChangedSince(ctx context.Context, repositories []string, since time.Time) ([]FeedPullRequest, error)
ChangedSince returns pull requests of the repositories updated at or after since.
func (*FeedPullRequests) Delete ¶ added in v0.29.0
Delete removes the pull request and its deliveries; a missing row is fine.
func (*FeedPullRequests) DeleteAll ¶ added in v0.29.0
func (r *FeedPullRequests) DeleteAll(ctx context.Context) (int, error)
DeleteAll removes every pull request and its deliveries and returns how many pull requests went.
func (*FeedPullRequests) DeleteRepositories ¶ added in v0.29.0
func (r *FeedPullRequests) DeleteRepositories(ctx context.Context, repositories []string) (int, error)
DeleteRepositories removes the pull requests of the repositories and their deliveries.
func (*FeedPullRequests) Repositories ¶ added in v0.29.0
func (r *FeedPullRequests) Repositories(ctx context.Context) ([]string, error)
Repositories returns the distinct repositories that have a pull request, sorted.
func (*FeedPullRequests) Upsert ¶ added in v0.29.0
func (r *FeedPullRequests) Upsert(ctx context.Context, pullRequest FeedPullRequest) error
Upsert inserts or updates the pull request in place, keeping its deliveries and a known created_at.
type FeedSubscription ¶ added in v0.29.0
type FeedSubscription struct {
ID int64 `gorm:"primaryKey;autoIncrement"`
TokenID string `gorm:"column:token_id;not null"`
Repository string `gorm:"column:repository;not null"`
CreatedAt time.Time `gorm:"column:created_at;not null;autoCreateTime:false"`
}
FeedSubscription is one repository (or "*") an agent token follows.
func (FeedSubscription) TableName ¶ added in v0.29.0
func (FeedSubscription) TableName() string
TableName pins the table name.
type FeedSubscriptionBatch ¶ added in v0.29.0
FeedSubscriptionBatch is a set of repositories to subscribe a token to.
type FeedSubscriptions ¶ added in v0.29.0
type FeedSubscriptions struct {
// contains filtered or unexported fields
}
FeedSubscriptions persists which repositories each token follows.
func NewFeedSubscriptions ¶ added in v0.29.0
func NewFeedSubscriptions(db *gorm.DB) *FeedSubscriptions
NewFeedSubscriptions constructs a FeedSubscriptions repository bound to db.
func (*FeedSubscriptions) Add ¶ added in v0.29.0
func (r *FeedSubscriptions) Add(ctx context.Context, batch FeedSubscriptionBatch) (int, error)
Add inserts the repositories not yet subscribed and returns how many were new.
func (*FeedSubscriptions) Delete ¶ added in v0.29.0
func (r *FeedSubscriptions) Delete(ctx context.Context, tokenID string, id int64) (FeedSubscription, error)
Delete removes the token's subscription and returns it, or ErrNotFound.
func (*FeedSubscriptions) DeleteRepositories ¶ added in v0.29.0
func (r *FeedSubscriptions) DeleteRepositories(ctx context.Context, repositories []string) (int, error)
DeleteRepositories removes the repositories' subscriptions of every token and returns how many rows went.
func (*FeedSubscriptions) List ¶ added in v0.29.0
func (r *FeedSubscriptions) List(ctx context.Context, tokenID string) ([]FeedSubscription, error)
List returns the token's subscriptions in id order.
func (*FeedSubscriptions) Repositories ¶ added in v0.29.0
func (r *FeedSubscriptions) Repositories(ctx context.Context) ([]string, error)
Repositories returns the distinct repositories that have a subscription, sorted.
type Message ¶
type Message struct {
ID uint `gorm:"primaryKey"`
PullRequestID uint `gorm:"column:pull_request_id;not null"`
Channel string `gorm:"column:channel;not null"`
MessageID string `gorm:"column:message_id;not null"`
}
Message is one posted messenger message for a PR. (PullRequestID, Channel) is unique — at most one message per channel per PR. Channel is a room in the messenger; MessageID is the messenger's id for the post (Slack's ts).
type PullRequest ¶
type PullRequest struct {
ID uint `gorm:"primaryKey"`
Repository string `gorm:"column:gh_repository;not null"`
PRNumber int `gorm:"column:pr_number;not null"`
CreatedAt time.Time `gorm:"column:created_at;not null"`
UpdatedAt time.Time `gorm:"column:updated_at;not null"`
ClosedAt *time.Time `gorm:"column:closed_at"`
Messages []Message `gorm:"foreignKey:PullRequestID;constraint:OnDelete:CASCADE"`
}
PullRequest is one tracked PR. (Repository, PRNumber) is the natural key; CreatedAt is kept for later statistics, UpdatedAt is the activity clock (bumped on open and every review/comment) driving digest idle-detection and cleanup, and ClosedAt (nil = open) marks merged/closed so the digest skips it.
func (PullRequest) TableName ¶
func (PullRequest) TableName() string
TableName pins the table name; do not rely on GORM pluralization.
type PullRequests ¶
type PullRequests struct {
// contains filtered or unexported fields
}
PullRequests persists tracked PRs and their per-channel messenger messages.
func NewPullRequests ¶
func NewPullRequests(db *gorm.DB) *PullRequests
NewPullRequests constructs a PullRequests repository bound to db.
func (*PullRequests) AddMessage ¶
func (r *PullRequests) AddMessage(ctx context.Context, repository string, prNumber int, channel, messageID string) error
AddMessage records one posted message, creating the PR row on first sight. Insertion is idempotent on (pull_request_id, channel): re-adding the same channel for the same PR is a no-op, which makes the open fan-out safe to replay after a partial failure or GitHub redelivery.
func (*PullRequests) Delete ¶
Delete removes the PR and (by cascade) its messages. Missing PR is a no-op.
func (*PullRequests) DeleteStaleBefore ¶
DeleteStaleBefore removes PRs idle since before cutoff (messages cascade).
func (*PullRequests) FindStuck ¶
func (r *PullRequests) FindStuck(ctx context.Context, cutoff time.Time) ([]PullRequest, error)
FindStuck returns open PRs idle since before cutoff, oldest first. Messages are deliberately not preloaded: the digest routes from config, not from where a PR's message happens to live.
func (*PullRequests) ListOpen ¶
func (r *PullRequests) ListOpen(ctx context.Context) ([]PullRequest, error)
ListOpen returns every not-yet-closed PR, ordered for stable output.
func (*PullRequests) ListOpenWithMessages ¶ added in v0.25.0
func (r *PullRequests) ListOpenWithMessages(ctx context.Context) ([]PullRequest, error)
ListOpenWithMessages returns every not-yet-closed PR with its messages preloaded, ordered for stable output. It backs the relocate tooling, which needs to see where each open PR's messages currently live.
func (*PullRequests) MarkClosed ¶
MarkClosed sets closed_at. Missing PR is a no-op.
func (*PullRequests) Messages ¶
func (r *PullRequests) Messages(ctx context.Context, repository string, prNumber int) ([]Message, error)
Messages returns the PR's messages, or ErrNotFound when the PR is unknown.
func (*PullRequests) MoveMessage ¶ added in v0.25.0
func (r *PullRequests) MoveMessage(ctx context.Context, repository string, prNumber int, fromChannel, toChannel, messageID string) error
MoveMessage retargets the PR's message row in fromChannel at toChannel and the newly posted messageID. Retargeting the existing row rather than deleting and re-inserting keeps the (pull_request_id, channel) uniqueness a single statement. ErrNotFound when the PR has no message in fromChannel.
func (*PullRequests) RemoveMessage ¶ added in v0.25.0
func (r *PullRequests) RemoveMessage(ctx context.Context, repository string, prNumber int, channel string) error
RemoveMessage drops the PR's message row for channel, leaving the Slack message itself alone. ErrNotFound when there is no such row.
type Reactions ¶
type Reactions = routingdomain.Reactions
Reactions aliases the routing domain value object during the migration.
type RepoMapping ¶
type RepoMapping = routingdomain.RepoMapping
RepoMapping aliases the routing domain value object during the migration.
type ScheduledItem ¶ added in v0.27.0
type ScheduledItem struct {
ID uint
Repository string
PRNumber int
Channel string
Mentions []string
Title string
URL string
Author string
QueuedAt time.Time
}
ScheduledItem is a scheduled notification with its PR's natural key.
type ScheduledNotification ¶ added in v0.27.0
type ScheduledNotification struct {
ID uint `gorm:"primaryKey"`
PullRequestID uint `gorm:"column:pull_request_id;not null"`
Channel string `gorm:"column:channel;not null"`
Mentions []string `gorm:"column:mentions;serializer:json;not null"`
Title string `gorm:"column:title;not null"`
URL string `gorm:"column:url;not null"`
Author string `gorm:"column:author;not null"`
QueuedAt time.Time `gorm:"column:queued_at;not null"`
SentAt *time.Time `gorm:"column:sent_at"`
}
ScheduledNotification is one queued PR announcement for one channel under the scheduled notification strategy. SentAt nil means it waits for the next tick. (PullRequestID, Channel) is unique, so a PR is announced in a channel once; it is cascade-deleted with its PullRequest.
func (ScheduledNotification) TableName ¶ added in v0.27.0
func (ScheduledNotification) TableName() string
TableName pins the table name.
type ScheduledNotifications ¶ added in v0.27.0
type ScheduledNotifications struct {
// contains filtered or unexported fields
}
ScheduledNotifications persists the queue of the scheduled notification strategy. Callers name a PR by its natural key; the pull_request_id is resolved internally.
func NewScheduledNotifications ¶ added in v0.27.0
func NewScheduledNotifications(db *gorm.DB) *ScheduledNotifications
NewScheduledNotifications constructs a ScheduledNotifications repository bound to db.
func (*ScheduledNotifications) AnnouncedSince ¶ added in v0.27.0
func (r *ScheduledNotifications) AnnouncedSince(ctx context.Context, cutoff time.Time) ([]ScheduledItem, error)
AnnouncedSince returns the items still waiting for a send or sent at or after cutoff.
func (*ScheduledNotifications) Enqueue ¶ added in v0.27.0
func (r *ScheduledNotifications) Enqueue(ctx context.Context, item ScheduledItem) error
Enqueue queues the item, creating the PR row on first sight so the close and draft handlers find it. It is idempotent on (PR, channel), also after the row was sent: a webhook redelivery never announces a PR twice in a channel.
func (*ScheduledNotifications) MarkSent ¶ added in v0.27.0
MarkSent stamps the items as sent at sentAt.
func (*ScheduledNotifications) Pending ¶ added in v0.27.0
func (r *ScheduledNotifications) Pending(ctx context.Context) ([]ScheduledItem, error)
Pending returns the unsent items of open PRs, oldest first.
type Target ¶
type Target = routingdomain.Target
Target aliases the routing domain value object during the migration.