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