Documentation
¶
Index ¶
- Constants
- func NormalizeWindow(since, until time.Time) (time.Time, time.Time)
- 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
- type APIBranches
- type APIBullet
- type APIRepo
- type APISection
- type APITotals
- type APIWarnings
- type APIWindow
- type Bullet
- type CloudClient
- type CloudConfig
- type CreateDispatchRequest
- type CreateDispatchResponse
- 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.
Variables ¶
This section is empty.
Functions ¶
func ParseSinceAtNow ¶
ParseSinceAtNow parses durations like 7d, relative times like "2 days ago", RFC3339 timestamps, and ISO dates.
func RenderMarkdown ¶
Types ¶
type APIBranches ¶
func (*APIBranches) UnmarshalJSON ¶
func (b *APIBranches) UnmarshalJSON(data []byte) error
type APIRepo ¶
type APIRepo struct {
FullName string `json:"full_name"`
URL string `json:"url,omitempty"`
Sections []APISection `json:"sections"`
}
type APISection ¶
type APIWarnings ¶
type CloudClient ¶
type CloudClient struct {
// contains filtered or unexported fields
}
func NewCloudClient ¶
func NewCloudClient(cfg CloudConfig) *CloudClient
func (*CloudClient) CreateDispatch ¶
func (c *CloudClient) CreateDispatch(ctx context.Context, reqBody CreateDispatchRequest, jurisdiction string) (*CreateDispatchResponse, error)
CreateDispatch generates a one-off dispatch from the cell of `jurisdiction` ("" = the caller's home jurisdiction).
type CloudConfig ¶
type CreateDispatchRequest ¶
type CreateDispatchResponse ¶
type CreateDispatchResponse struct {
// Jurisdiction is the slug the gateway stamps onto the response: the
// jurisdiction whose cell the dispatch was generated from. Empty from a
// gateway that predates the selector — see runServer for how a sent
// selector is checked against it.
Jurisdiction string `json:"jurisdiction,omitempty"`
Window APIWindow `json:"window"`
Title string `json:"title,omitempty"`
CoveredRepos []string `json:"covered_repos,omitempty"`
Branches APIBranches `json:"branches,omitempty"`
Voice *string `json:"voice"`
Repos []APIRepo `json:"repos,omitempty"`
Totals APITotals `json:"totals"`
Warnings APIWarnings `json:"warnings"`
GeneratedText string `json:"generated_text,omitempty"`
GeneratedMarkdown string `json:"generated_markdown,omitempty"`
}
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 — the pre-selector behaviour. 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 gateway'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 gateway'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