Documentation
¶
Overview ¶
Package gittest provides an in-memory git.Host for tests.
Index ¶
- type Host
- func (h *Host) CloneURL(org, name string) string
- func (h *Host) CreatePrivateRepo(_ context.Context, org, name string) error
- func (h *Host) DeleteRepo(_ context.Context, org, name string) error
- func (h *Host) OpenPullRequest(_ context.Context, owner, repo, head, base, title, body string) (string, error)
- func (h *Host) Orgs(context.Context) ([]string, error)
- func (h *Host) ReleaseTags(context.Context, string, string) ([]string, error)
- func (h *Host) RepoState(_ context.Context, org, name string) (git.RepoState, error)
- func (h *Host) Token() string
- func (h *Host) Validate(context.Context) (string, error)
- type PullRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Host ¶
type Host struct {
User string
Password string
OrgNames []string
// Repos maps "org/name" to its state; a repository that is not listed is missing.
Repos map[string]git.RepoState
// URLs maps "org/name" to the clone URL; unlisted repositories get an unreachable https URL.
URLs map[string]string
// Releases are the release tags of the kubriX source repository, newest first; ReleasesErr makes listing fail.
Releases []string
ReleasesErr error
// PRErr makes OpenPullRequest fail.
PRErr error
Created []string
Deleted []string
PRs []PullRequest
}
Host is a git.Host that keeps repositories in memory. Set URLs to point clone URLs at local bare repositories.
func (*Host) CreatePrivateRepo ¶
func (*Host) OpenPullRequest ¶
func (*Host) ReleaseTags ¶
ReleaseTags lists Releases, standing in for the kubriX source repository's tags.
type PullRequest ¶
type PullRequest struct {
Owner, Repo, Head, Base, Title, Body string
}
PullRequest is one call to OpenPullRequest.