Documentation
¶
Index ¶
- Variables
- func FindRepository(options RepositoryLookup) (git.RepositoryInfo, error)
- func IsGitType(kind string) bool
- type CacheAction
- type CacheInventory
- type CacheRepository
- type Commit
- type Connection
- type Files
- type Opened
- type Options
- type Ref
- type Refs
- type Repository
- type RepositoryLookup
- type Request
- type Service
- func (s *Service) Cache(ctx context.Context) (CacheInventory, error)
- func (s *Service) CacheEvict(ctx context.Context, action CacheAction) (git.EvictResult, error)
- func (s *Service) CacheOwners(ctx context.Context, request Request) ([]git.SharedOwner, error)
- func (s *Service) CachePrune(ctx context.Context, action CacheAction) (git.CacheEntry, error)
- func (s *Service) CacheRebind(ctx context.Context, action CacheAction) (git.RebindResult, error)
- func (s *Service) Commits(ctx context.Context, request Request) (git.Page[Commit], error)
- func (s *Service) Connections(ctx context.Context) ([]Connection, error)
- func (s *Service) Executions(ctx context.Context, request Request) (git.Page[git.PipelineExecution], error)
- func (s *Service) Files(ctx context.Context, request Request) (Files, error)
- func (s *Service) Open(ctx context.Context, request Request) (*Opened, error)
- func (s *Service) Pipelines(ctx context.Context, request Request) (git.Page[git.Pipeline], error)
- func (s *Service) ReadFile(ctx context.Context, request Request) ([]byte, error)
- func (s *Service) Refs(ctx context.Context, request Request) (Refs, error)
- func (s *Service) RemoteRefs(ctx context.Context, repo *git.Repository) (git.RemoteRefs, error)
- func (s *Service) Repositories(ctx context.Context, request Request) ([]Repository, error)
- func (s *Service) ResolveRef(ctx context.Context, repo *git.Repository, name string) (git.Ref, error)
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalid = errors.New("invalid git source") ErrUnknownConnection = errors.New("unknown git connection") )
Functions ¶
func FindRepository ¶ added in v0.1.72
func FindRepository(options RepositoryLookup) (git.RepositoryInfo, error)
Types ¶
type CacheAction ¶ added in v0.1.72
type CacheAction struct {
Owner string `json:"owner,omitempty"`
Connection string `json:"connection,omitempty"`
Repo string `json:"repo,omitempty"`
}
CacheAction names what a cache action applies to: Owner (a cache key) for prune and evict; Connection and Repo, plus an optional Owner, for rebind.
type CacheInventory ¶ added in v0.1.72
type CacheInventory struct {
Entries []CacheRepository `json:"entries"`
ConnectionErrors map[string]string `json:"connectionErrors,omitempty"`
}
CacheInventory is every git cache entry. ConnectionErrors names the catalog connections whose repositories could not be listed, so entries they serve show no connection.
type CacheRepository ¶ added in v0.1.72
type CacheRepository struct {
git.CacheEntry
Connection string `json:"connection,omitempty"`
Repo string `json:"repo,omitempty"`
}
CacheRepository is a git cache entry with the catalog connection and repository it caches. Connection is empty when no catalog connection serves the entry; Repo is empty for a connection pinned to one repository.
type Connection ¶
type Opened ¶ added in v0.1.72
type Opened struct {
Client *git.Client
Repository *git.Repository
Name string
Info git.RepositoryInfo
}
type Options ¶
type Options struct {
Catalog func(context.Context) ([]models.Connection, error)
Resolve func(context.Context, string) (models.Connection, error)
CacheDir string
PinTTL time.Duration
Client func(context.Context, string) (*git.Client, models.Connection, error)
ClientScope func(context.Context) (string, error)
}
Options configures New. PinTTL is how long a commit pin survives without a read when CachePrune prunes a mirror (prune is refused without one).
type Repository ¶
type Repository struct {
Name string `json:"name"`
FullName string `json:"fullName"`
Namespace string `json:"namespace,omitempty"`
CloneURL string `json:"cloneUrl,omitempty"`
WebURL string `json:"webUrl,omitempty"`
DefaultBranch string `json:"defaultBranch,omitempty"`
Private bool `json:"private,omitempty"`
Archived bool `json:"archived,omitempty"`
}
type RepositoryLookup ¶ added in v0.1.72
type RepositoryLookup struct {
Name string
Connection string
Repositories []git.RepositoryInfo
}
type Request ¶
type Request struct {
Connection string `json:"connection"`
Repo string `json:"repo,omitempty"`
Ref string `json:"ref,omitempty"`
Path string `json:"path,omitempty"`
Pipeline string `json:"pipeline,omitempty"`
Branch string `json:"branch,omitempty"`
Cursor string `json:"cursor,omitempty"`
Limit int `json:"limit,omitempty"`
Extensions []string `json:"extensions,omitempty"`
}
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) Cache ¶ added in v0.1.72
func (s *Service) Cache(ctx context.Context) (CacheInventory, error)
Cache describes the git cache, joined to the catalog's repositories.
func (*Service) CacheEvict ¶ added in v0.1.72
func (s *Service) CacheEvict(ctx context.Context, action CacheAction) (git.EvictResult, error)
CacheEvict deletes the owner mirror; it and its dependents clone again on their next read.
func (*Service) CacheOwners ¶ added in v0.1.72
CacheOwners ranks the mirrors the request's repository could bind to.
func (*Service) CachePrune ¶ added in v0.1.72
func (s *Service) CachePrune(ctx context.Context, action CacheAction) (git.CacheEntry, error)
CachePrune expires the owner mirror's unused pins and garbage-collects it, returning its refreshed entry.
func (*Service) CacheRebind ¶ added in v0.1.72
func (s *Service) CacheRebind(ctx context.Context, action CacheAction) (git.RebindResult, error)
CacheRebind binds the action's repository to action.Owner, or to the best shared owner when Owner is empty.
func (*Service) Connections ¶
func (s *Service) Connections(ctx context.Context) ([]Connection, error)
func (*Service) Executions ¶
func (*Service) RemoteRefs ¶ added in v0.1.72
func (s *Service) RemoteRefs(ctx context.Context, repo *git.Repository) (git.RemoteRefs, error)