repo.go

 1package proto
 2
 3import (
 4	"time"
 5
 6	"github.com/charmbracelet/soft-serve/git"
 7)
 8
 9// Repository is a Git repository interface.
10type Repository interface {
11	// ID returns the repository's ID.
12	ID() int64
13	// Name returns the repository's name.
14	Name() string
15	// ProjectName returns the repository's project name.
16	ProjectName() string
17	// Description returns the repository's description.
18	Description() string
19	// IsPrivate returns whether the repository is private.
20	IsPrivate() bool
21	// IsMirror returns whether the repository is a mirror.
22	IsMirror() bool
23	// IsHidden returns whether the repository is hidden.
24	IsHidden() bool
25	// UpdatedAt returns the time the repository was last updated.
26	// If the repository has never been updated, it returns the time it was created.
27	UpdatedAt() time.Time
28	// Open returns the underlying git.Repository.
29	Open() (*git.Repository, error)
30}
31
32// RepositoryOptions are options for creating a new repository.
33type RepositoryOptions struct {
34	Private     bool
35	Description string
36	ProjectName string
37	Mirror      bool
38	Hidden      bool
39}