projects

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: May 22, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package projects will manage project registration and lookup behavior.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddInput

type AddInput struct {
	ID           string
	Name         string
	RepoPath     string
	BaseBranch   string
	IDSource     string
	WorktreeRoot *string
	Repo         *string
	SnapshotMode SnapshotMode
}

type AddResult

type AddResult struct {
	Project                storage.ProjectRecord
	Repo                   *string
	DiscoveredPullRequests int
	DiscoveredWorktrees    int
	PendingSnapshots       int
	CapturedSnapshots      int
	Warnings               []string
}

type AmbiguousProjectIdentifierError

type AmbiguousProjectIdentifierError struct{ Identifier string }

func (AmbiguousProjectIdentifierError) Error

type CapturePullRequestSnapshotInput

type CapturePullRequestSnapshotInput struct {
	ProjectID  string
	Repo       string
	PRNumber   int64
	CWD        string
	CapturedAt string
}

type DetectRepoFunc

type DetectRepoFunc func(context.Context, string) (string, error)

type GetBranchProtectionFunc added in v0.8.0

type ListOpenPullRequestsInput

type ListOpenPullRequestsInput struct {
	Repo    string
	CWD     string
	Limit   int
	Timeout time.Duration
}

type ListWorktreesFunc

type ListWorktreesFunc func(context.Context, string) ([]WorktreeListEntry, error)

type ProjectIDCollisionError

type ProjectIDCollisionError struct{ ProjectID string }

func (ProjectIDCollisionError) Error

func (e ProjectIDCollisionError) Error() string

type ProjectNotFoundError

type ProjectNotFoundError struct{ Identifier string }

func (ProjectNotFoundError) Error

func (e ProjectNotFoundError) Error() string

type ProjectValidationError

type ProjectValidationError struct{ Message string }

func (ProjectValidationError) Error

func (e ProjectValidationError) Error() string

type PullRequestSummary

type PullRequestSummary struct {
	Number  int64
	State   string
	IsDraft bool
}

type Service

type Service struct {
	DB                         *sql.DB
	Repos                      *storage.Repositories
	Logger                     bootstrap.Logger
	Config                     config.Config
	Now                        func() time.Time
	DetectRepo                 DetectRepoFunc
	GetRepositorySettings      GetRepositorySettingsFunc
	GetBranchProtection        GetBranchProtectionFunc
	ListWorktrees              ListWorktreesFunc
	ListOpenPullRequests       ListOpenPullRequestsFunc
	CapturePullRequestSnapshot CapturePullRequestSnapshotFunc
	AsyncSnapshotQueueEnabled  func() bool
}

func (*Service) AddProject

func (s *Service) AddProject(ctx context.Context, input AddInput) (AddResult, error)

func (*Service) Get

func (s *Service) Get(ctx context.Context, id string) (*storage.ProjectRecord, error)

func (*Service) List

func (s *Service) List(ctx context.Context) ([]storage.ProjectRecord, error)

func (*Service) RemoveProject

func (s *Service) RemoveProject(ctx context.Context, identifier string) (storage.ProjectRecord, error)

func (*Service) SyncConfigured

func (s *Service) SyncConfigured(ctx context.Context, cfg config.Config, now time.Time) error

type SnapshotMode

type SnapshotMode string
const (
	SnapshotModeAsync SnapshotMode = "async"
	SnapshotModeFull  SnapshotMode = "full"
	SnapshotModeOff   SnapshotMode = "off"
)

type WorktreeListEntry

type WorktreeListEntry struct {
	Path    string
	Branch  string
	HeadSHA string
	Bare    bool
}

Jump to

Keyboard shortcuts

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