infrastructure

package
v0.29.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package infrastructure holds the feed adapters.

Index

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) Delete

func (repo *PullRequestRepo) Delete(ctx context.Context, repository string, number int) error

Delete 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.

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.

type SystemClock

type SystemClock struct{}

SystemClock is the wall-clock Clock.

func NewSystemClock

func NewSystemClock() *SystemClock

NewSystemClock returns a SystemClock.

func (*SystemClock) Now

func (*SystemClock) Now() time.Time

Now implements Clock.

Jump to

Keyboard shortcuts

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