Documentation
¶
Index ¶
- Variables
- func EnoughFreeSpace(path string, minBytes uint64) (bool, error)
- func RepositoryTooLarge(sizeBytes, maxBytes int64) bool
- type ActiveJobs
- type ArchiveDownloader
- type ArchiveLimits
- type ArchiveSnapshotProvider
- func (provider ArchiveSnapshotProvider) Cleanup(_ context.Context, snapshot Snapshot) error
- func (provider ArchiveSnapshotProvider) CleanupStale(ctx context.Context, active ActiveJobs) error
- func (provider ArchiveSnapshotProvider) FreeSpacePath() string
- func (provider ArchiveSnapshotProvider) Prepare(ctx context.Context, request SnapshotRequest) (snapshot Snapshot, err error)
- type Enricher
- type EnrichmentStatus
- type Git
- func (git *Git) Cleanup(ctx context.Context, repositoryID, jobID int64) error
- func (git *Git) Prepare(ctx context.Context, repo repository.Repository, job postgres.IndexJob, ...) (string, string, error)
- func (git *Git) PrepareCommit(ctx context.Context, repo repository.Repository, jobID int64, ...) (string, string, error)
- func (git *Git) Prune(ctx context.Context, active map[int64]struct{}) error
- type GitSnapshotProvider
- func (provider GitSnapshotProvider) Cleanup(ctx context.Context, snapshot Snapshot) error
- func (provider GitSnapshotProvider) CleanupStale(ctx context.Context, active ActiveJobs) error
- func (provider GitSnapshotProvider) FreeSpacePath() string
- func (provider GitSnapshotProvider) Prepare(ctx context.Context, request SnapshotRequest) (Snapshot, error)
- type IndexPublisher
- type IndexStore
- type JobQueue
- type Runner
- type Snapshot
- type SnapshotProvider
- type SnapshotRequest
- type TokenSource
- type Worker
- type ZoektIndexer
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrTargetMissing = errors.New("target commit unavailable")
Functions ¶
func RepositoryTooLarge ¶
Types ¶
type ActiveJobs ¶
type ActiveJobs map[int64]struct{}
type ArchiveDownloader ¶
type ArchiveLimits ¶
type ArchiveSnapshotProvider ¶
type ArchiveSnapshotProvider struct {
Client ArchiveDownloader
WorkspacesDir string
Limits ArchiveLimits
Metrics *observability.Metrics
}
func (ArchiveSnapshotProvider) Cleanup ¶
func (provider ArchiveSnapshotProvider) Cleanup(_ context.Context, snapshot Snapshot) error
func (ArchiveSnapshotProvider) CleanupStale ¶
func (provider ArchiveSnapshotProvider) CleanupStale(ctx context.Context, active ActiveJobs) error
func (ArchiveSnapshotProvider) FreeSpacePath ¶
func (provider ArchiveSnapshotProvider) FreeSpacePath() string
func (ArchiveSnapshotProvider) Prepare ¶
func (provider ArchiveSnapshotProvider) Prepare(ctx context.Context, request SnapshotRequest) (snapshot Snapshot, err error)
type Enricher ¶
type Enricher interface {
Enrich(context.Context, Snapshot, repository.Repository, string) (EnrichmentStatus, error)
}
type EnrichmentStatus ¶
type EnrichmentStatus = postgres.EnrichmentStatus
type Git ¶
type Git struct {
Binary, BaseURL, AskPass, CABundle, MirrorsDir, WorktreesDir string
Runner Runner
CommandTimeout time.Duration
}
func (*Git) PrepareCommit ¶
func (git *Git) PrepareCommit(ctx context.Context, repo repository.Repository, jobID int64, targetSHA, token string) (string, string, error)
type GitSnapshotProvider ¶
type GitSnapshotProvider struct{ Git *Git }
func (GitSnapshotProvider) Cleanup ¶
func (provider GitSnapshotProvider) Cleanup(ctx context.Context, snapshot Snapshot) error
func (GitSnapshotProvider) CleanupStale ¶
func (provider GitSnapshotProvider) CleanupStale(ctx context.Context, active ActiveJobs) error
func (GitSnapshotProvider) FreeSpacePath ¶
func (provider GitSnapshotProvider) FreeSpacePath() string
func (GitSnapshotProvider) Prepare ¶
func (provider GitSnapshotProvider) Prepare(ctx context.Context, request SnapshotRequest) (Snapshot, error)
type IndexPublisher ¶
type IndexStore ¶
type JobQueue ¶
type JobQueue interface {
ClaimIndex(context.Context, string) (postgres.IndexJob, error)
RenewLease(context.Context, int64, string) error
PublishIndex(context.Context, int64, string) error
CompleteIndex(context.Context, int64, string, ...postgres.EnrichmentStatus) error
FailIndex(context.Context, int64, string, string, bool) error
ActiveJobIDs(context.Context) (map[int64]struct{}, error)
}
type SnapshotProvider ¶
type SnapshotRequest ¶
type SnapshotRequest struct {
RepositoryID int64
Repository repository.Repository
JobID int64
CommitSHA string
AccessToken string
}
type TokenSource ¶
type Worker ¶
type Worker struct {
ID string
Queue JobQueue
Store IndexStore
Tokens TokenSource
Snapshots SnapshotProvider
Zoekt IndexPublisher
Enricher Enricher
MinFreeBytes uint64
MaxRepositoryBytes int64
RenewEvery time.Duration
ReapEvery time.Duration
CleanupTimeout time.Duration
Metrics *observability.Metrics
// Logger receives one record per failed job with the phase error; job
// rows only keep the error code. Credentials never reach these errors.
Logger *slog.Logger
// contains filtered or unexported fields
}
type ZoektIndexer ¶
type ZoektIndexer struct {
Binary, IndexDir string
Runner Runner
Client *zoekt.Client
IndexTimeout time.Duration
VisibilityTimeout time.Duration
}
func (*ZoektIndexer) Index ¶
func (indexer *ZoektIndexer) Index(ctx context.Context, repo repository.Repository, source string) (resultErr error)
func (*ZoektIndexer) WaitVisible ¶
Click to show internal directories.
Click to hide internal directories.