github

package
v1.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 14, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsDegradedError added in v1.0.8

func IsDegradedError(err error) bool

IsDegradedError reports whether err represents connector degradation.

func IsRateLimitedError added in v1.1.1

func IsRateLimitedError(err error) bool

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 (c *Connector) AcquireRepo(ctx context.Context, repo string) (source.RepoManifest, error)

func (*Connector) ListOrgRepos

func (c *Connector) ListOrgRepos(ctx context.Context, org string) ([]string, error)

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 CooldownEvent struct {
	Delay time.Duration
	Until time.Time
}

type DegradedError added in v1.0.8

type DegradedError struct {
	CooldownUntil time.Time
	Cause         string
	Err           error
}

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 HTTPClient

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

type RateLimitedError added in v1.1.1

type RateLimitedError struct {
	StatusCode int
	Attempts   int
	Evidence   string
	Message    string
}

func (*RateLimitedError) Error added in v1.1.1

func (e *RateLimitedError) Error() string

type RetryEvent added in v1.0.11

type RetryEvent struct {
	Attempt    int
	StatusCode int
	Delay      time.Duration
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL