Documentation
¶
Index ¶
- Constants
- func GitHubRepoName(slug string) (string, bool)
- func NormalizeWindow(since, until time.Time) (time.Time, time.Time)
- func OriginRepoSlug(remoteURL string) (string, error)
- func ParseSinceAtNow(value string, now time.Time) (time.Time, error)
- func ParseUntilAtNow(value string, now time.Time) (time.Time, error)
- func RenderMarkdown(dispatch *Dispatch) string
- func SplitRepoSlug(value string) (forge, name string, ok bool)
- type APIBullet
- type APIRepo
- type APIRun
- type APISection
- type APIWindow
- type Bullet
- type CloudClient
- type CreateDispatchRequest
- type Dispatch
- type Mode
- type Options
- type RepoGroup
- type RepoNotFoundError
- type Section
- type TextGenerator
- type Voice
- type Window
Constants ¶
const CloudRepoLimit = 5
CloudRepoLimit caps how many repos the cloud mode may query in one request.
const GitHubForge = "gh"
GitHubForge is the forge token entire.io gives GitHub repos.
const NativeForge = "et"
NativeForge is the forge token of Entire-native repos.
const RepoSlugShapes = "gh/<owner>/<repo> or et/<project>/<repo>"
RepoSlugShapes lists every --repos shape, for error text.
Variables ¶
This section is empty.
Functions ¶
func GitHubRepoName ¶ added in v0.11.0
GitHubRepoName returns the owner/repo of a gh/ slug. ok is false for every other forge or shape: there is no github.com page for it.
func OriginRepoSlug ¶ added in v0.11.4
OriginRepoSlug derives the forge-qualified slug a dispatch addresses from a git remote URL: gh/<owner>/<repo> for github.com and entire://…/gh/… remotes, et/<project>/<repo> for entire://…/et/… remotes. The forge comes from the URL itself (its host, or the path token on an entire:// URL) rather than being assumed, so an Entire-native checkout dispatches as the native repo and a same-named GitHub mirror cannot answer for it. Any other host is an error: Entire holds no checkpoints for it, and the message names the --repos shapes so the user can address a repo explicitly.
func ParseSinceAtNow ¶
ParseSinceAtNow parses durations like 7d, relative times like "2 days ago", RFC3339 timestamps, and ISO dates.
func RenderMarkdown ¶
func SplitRepoSlug ¶ added in v0.11.0
SplitRepoSlug parses "forge/owner/repo" into a forge token and an owner/repo name. A bare owner/repo names no forge and is refused: both forges take that shape, so guessing one would reintroduce the collision the prefix exists to prevent (the same trade `repo clone` makes). ok is false for any other shape or an unknown forge token.
Types ¶
type APIRepo ¶
type APIRepo struct {
FullName string `json:"fullName"`
Sections []APISection `json:"sections"`
}
type APIRun ¶ added in v0.11.5
type APIRun struct {
ID string `json:"id"`
Status string `json:"status"`
CoveredRepos []string `json:"coveredRepos"`
Window APIWindow `json:"window"`
Repos []APIRepo `json:"repos"`
GeneratedMarkdown string `json:"generatedMarkdown"`
ErrorMessage *string `json:"errorMessage"`
}
APIRun is the cell's dispatch shape, served by both the create and the read route; only the fields the CLI renders are decoded.
type APISection ¶
type CloudClient ¶
type CloudClient struct {
// contains filtered or unexported fields
}
CloudClient generates dispatches on an entire-api cell: the caller's home cell, or the cell of the jurisdiction runServer was asked for.
func NewCloudClient ¶
func NewCloudClient(client *api.Client) *CloudClient
func (*CloudClient) CreateDispatch ¶
func (c *CloudClient) CreateDispatch(ctx context.Context, reqBody CreateDispatchRequest, jurisdiction string) (*APIRun, error)
CreateDispatch starts a dispatch on the client's cell and waits for it to finish. jurisdiction is the --jurisdiction selector the cell was picked by ("" = home); it only labels a repo-not-found error.
type CreateDispatchRequest ¶
type CreateDispatchRequest struct {
Repos []string `json:"repos,omitempty"`
Since string `json:"since"`
Until string `json:"until"`
Voice string `json:"voice,omitempty"`
}
CreateDispatchRequest is the body of POST /me/dispatches. Repos must be forge-qualified (gh/owner/repo or et/project/repo).
type Options ¶
type Options struct {
Mode Mode
RepoPaths []string
Since string
Until string
Branches []string
AllBranches bool
ImplicitCurrentBranch bool
Voice string
// Jurisdiction is the slug (e.g. "us") of the jurisdiction whose cell
// generates a cloud dispatch. Empty means the caller's home
// jurisdiction. Cloud mode only.
Jurisdiction string
InsecureHTTPAuth bool
TextGenerator TextGenerator
Model string
// contains filtered or unexported fields
}
func PrepareLocal ¶ added in v0.9.0
PrepareLocal validates and resolves the inputs needed before local dispatch generation can begin. The returned options can be passed to Run without repeating time-window parsing or repository-root discovery.
type RepoNotFoundError ¶ added in v0.10.4
type RepoNotFoundError struct {
Jurisdiction string
Home string
Repos []string
Message string
Cause error
}
RepoNotFoundError is the cell's 404 for a repo that is not placed in (or not visible in) the jurisdiction the request was routed to — a repo mirrored only in US, requested from an AU home, is simply unknown to the AU cell. Jurisdiction is the selector the caller sent ("" = home) and Home the caller's home jurisdiction when known (so callers know which cell answered when no selector was sent); Repos are the requested slugs the cell's message named; Message is its sentence; Cause is the underlying *api.HTTPError.
func (*RepoNotFoundError) Error ¶ added in v0.10.4
func (e *RepoNotFoundError) Error() string
func (*RepoNotFoundError) FailedJurisdiction ¶ added in v0.10.4
func (e *RepoNotFoundError) FailedJurisdiction() string
FailedJurisdiction is the jurisdiction whose cell answered "not found": the selector when one was sent, else the home jurisdiction ("" if unknown).
func (*RepoNotFoundError) Unwrap ¶ added in v0.10.4
func (e *RepoNotFoundError) Unwrap() error