Documentation
¶
Overview ¶
Package infrastructure holds the feed adapters.
Index ¶
- func NewRoutes(subscriptions domain.Subscriptions, pullRequests domain.PullRequests, ...) []httpx.Route
- type DeliveryRepo
- type PullRequestRepo
- func (repo *PullRequestRepo) ChangedSince(ctx context.Context, repositories []string, since time.Time) ([]domain.PullRequest, error)
- func (repo *PullRequestRepo) Delete(ctx context.Context, repository string, number int) error
- func (repo *PullRequestRepo) DeleteAll(ctx context.Context) (int, error)
- func (repo *PullRequestRepo) DeleteRepositories(ctx context.Context, repositories []string) (int, error)
- func (repo *PullRequestRepo) Repositories(ctx context.Context) ([]string, error)
- func (repo *PullRequestRepo) Upsert(ctx context.Context, pullRequest domain.PullRequest) error
- type RoutingCatalog
- type SubscriptionRepo
- func (repo *SubscriptionRepo) Add(ctx context.Context, newSubscriptions domain.NewSubscriptions) (int, error)
- func (repo *SubscriptionRepo) Delete(ctx context.Context, tokenID string, id int64) (domain.Subscription, error)
- func (repo *SubscriptionRepo) DeleteRepositories(ctx context.Context, repositories []string) (int, error)
- func (repo *SubscriptionRepo) List(ctx context.Context, tokenID string) ([]domain.Subscription, error)
- func (repo *SubscriptionRepo) Repositories(ctx context.Context) ([]string, error)
- type SystemClock
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRoutes ¶
func NewRoutes(subscriptions domain.Subscriptions, pullRequests domain.PullRequests, logger *slog.Logger) []httpx.Route
NewRoutes returns the agent feed routes; the caller guards them with the bearer middleware.
Types ¶
type DeliveryRepo ¶
type DeliveryRepo struct {
// contains filtered or unexported fields
}
DeliveryRepo adapts persistence.FeedDeliveries to domain.DeliveryStore.
func NewDeliveryRepo ¶
func NewDeliveryRepo(deliveries *persistence.FeedDeliveries) *DeliveryRepo
NewDeliveryRepo wraps the deliveries repository.
func (*DeliveryRepo) Claim ¶
func (repo *DeliveryRepo) Claim(ctx context.Context, claim domain.Claim) ([]domain.PullRequest, error)
Claim implements domain.DeliveryStore.
type PullRequestRepo ¶
type PullRequestRepo struct {
// contains filtered or unexported fields
}
PullRequestRepo adapts persistence.FeedPullRequests to domain.PullRequestStore.
func NewPullRequestRepo ¶
func NewPullRequestRepo(pullRequests *persistence.FeedPullRequests) *PullRequestRepo
NewPullRequestRepo wraps the pull-requests repository.
func (*PullRequestRepo) ChangedSince ¶
func (repo *PullRequestRepo) ChangedSince(ctx context.Context, repositories []string, since time.Time) ([]domain.PullRequest, error)
ChangedSince implements domain.PullRequestStore.
func (*PullRequestRepo) DeleteAll ¶
func (repo *PullRequestRepo) DeleteAll(ctx context.Context) (int, error)
DeleteAll implements domain.PullRequestStore.
func (*PullRequestRepo) DeleteRepositories ¶
func (repo *PullRequestRepo) DeleteRepositories(ctx context.Context, repositories []string) (int, error)
DeleteRepositories implements domain.PullRequestStore.
func (*PullRequestRepo) Repositories ¶
func (repo *PullRequestRepo) Repositories(ctx context.Context) ([]string, error)
Repositories implements domain.PullRequestStore.
func (*PullRequestRepo) Upsert ¶
func (repo *PullRequestRepo) Upsert(ctx context.Context, pullRequest domain.PullRequest) error
Upsert implements domain.PullRequestStore.
type RoutingCatalog ¶
type RoutingCatalog struct {
// contains filtered or unexported fields
}
RoutingCatalog answers which repositories the routing mappings configure.
func NewRoutingCatalog ¶
func NewRoutingCatalog(entries routingdomain.EntryLister) *RoutingCatalog
NewRoutingCatalog indexes the entries of the configured mappings.
func (*RoutingCatalog) Configured ¶
func (catalog *RoutingCatalog) Configured(repositories []string) []string
Configured implements domain.RepositoryCatalog.
func (*RoutingCatalog) HasRepositories ¶
func (catalog *RoutingCatalog) HasRepositories() bool
HasRepositories implements domain.RepositoryCatalog.
func (*RoutingCatalog) IsConfigured ¶
func (catalog *RoutingCatalog) IsConfigured(repository string) bool
IsConfigured implements domain.RepositoryCatalog.
func (*RoutingCatalog) List ¶ added in v0.31.0
func (catalog *RoutingCatalog) List() domain.ConfiguredRepositories
List implements domain.RepositoryCatalog.
type SubscriptionRepo ¶
type SubscriptionRepo struct {
// contains filtered or unexported fields
}
SubscriptionRepo adapts persistence.FeedSubscriptions to domain.SubscriptionStore.
func NewSubscriptionRepo ¶
func NewSubscriptionRepo(subscriptions *persistence.FeedSubscriptions) *SubscriptionRepo
NewSubscriptionRepo wraps the subscriptions repository.
func (*SubscriptionRepo) Add ¶
func (repo *SubscriptionRepo) Add(ctx context.Context, newSubscriptions domain.NewSubscriptions) (int, error)
Add implements domain.SubscriptionStore.
func (*SubscriptionRepo) Delete ¶
func (repo *SubscriptionRepo) Delete(ctx context.Context, tokenID string, id int64) (domain.Subscription, error)
Delete implements domain.SubscriptionStore.
func (*SubscriptionRepo) DeleteRepositories ¶
func (repo *SubscriptionRepo) DeleteRepositories(ctx context.Context, repositories []string) (int, error)
DeleteRepositories implements domain.SubscriptionStore.
func (*SubscriptionRepo) List ¶
func (repo *SubscriptionRepo) List(ctx context.Context, tokenID string) ([]domain.Subscription, error)
List implements domain.SubscriptionStore.
func (*SubscriptionRepo) Repositories ¶
func (repo *SubscriptionRepo) Repositories(ctx context.Context) ([]string, error)
Repositories implements domain.SubscriptionStore.