Documentation
¶
Index ¶
- func IsDegradedError(err error) bool
- func IsRateLimitedError(err error) bool
- type Connector
- func (c *Connector) AcquireRepo(ctx context.Context, repo string) (source.RepoManifest, error)
- func (c *Connector) ListOrgRepos(ctx context.Context, org string) ([]string, error)
- func (c *Connector) MaterializeRepo(ctx context.Context, repo string, materializedRoot string) (source.RepoManifest, error)
- func (c *Connector) SetCooldownHandler(fn func(CooldownEvent))
- func (c *Connector) SetRetryHandler(fn func(RetryEvent))
- type CooldownEvent
- type DegradedError
- type HTTPClient
- type RateLimitedError
- type RetryEvent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsDegradedError ¶ added in v1.0.8
IsDegradedError reports whether err represents connector degradation.
func IsRateLimitedError ¶ added in v1.1.1
IsRateLimitedError reports whether err represents exhausted hosted throttling.
Types ¶
type Connector ¶
type Connector struct {
BaseURL string
Token string
HTTPClient HTTPClient
MaxRetries int
Backoff time.Duration
MaxBackoff time.Duration
FailureThreshold int
Cooldown time.Duration
// contains filtered or unexported fields
}
Connector acquires GitHub repos/org lists with deterministic request semantics.
func NewConnector ¶
func NewConnector(baseURL, token string, client HTTPClient) *Connector
func (*Connector) AcquireRepo ¶
func (*Connector) ListOrgRepos ¶
func (*Connector) MaterializeRepo ¶ added in v1.0.2
func (c *Connector) MaterializeRepo(ctx context.Context, repo string, materializedRoot string) (source.RepoManifest, error)
MaterializeRepo fetches repository file contents through the GitHub API and writes them into a deterministic local workspace under materializedRoot.
func (*Connector) SetCooldownHandler ¶ added in v1.0.11
func (c *Connector) SetCooldownHandler(fn func(CooldownEvent))
func (*Connector) SetRetryHandler ¶ added in v1.0.11
func (c *Connector) SetRetryHandler(fn func(RetryEvent))
type CooldownEvent ¶ added in v1.0.11
type DegradedError ¶ added in v1.0.8
DegradedError indicates connector circuit-breaker degradation.
func (*DegradedError) Error ¶ added in v1.0.8
func (e *DegradedError) Error() string
func (*DegradedError) Unwrap ¶ added in v1.1.1
func (e *DegradedError) Unwrap() error
type RateLimitedError ¶ added in v1.1.1
func (*RateLimitedError) Error ¶ added in v1.1.1
func (e *RateLimitedError) Error() string
Click to show internal directories.
Click to hide internal directories.