github

package
v1.0.11 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 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.

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
}

DegradedError indicates connector circuit-breaker degradation.

func (*DegradedError) Error added in v1.0.8

func (e *DegradedError) Error() string

type HTTPClient

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

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