github

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2026 License: GPL-3.0 Imports: 10 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Start(ctx context.Context) error
	Stop() error

	// Runners.
	ListOrgRunners(ctx context.Context, org string) ([]*Runner, error)
	ListRepoRunners(ctx context.Context, owner, repo string) ([]*Runner, error)

	// Workflows.
	TriggerWorkflowDispatch(
		ctx context.Context,
		owner, repo, workflowID, ref string,
		inputs map[string]string,
	) error
	GetWorkflowRun(ctx context.Context, owner, repo string, runID int64) (*WorkflowRun, error)
	ListWorkflowRuns(ctx context.Context, owner, repo, workflowID string, opts ListWorkflowRunsOpts) ([]*WorkflowRun, error)
	ListWorkflowRunJobs(ctx context.Context, owner, repo string, runID int64) ([]*WorkflowJob, error)
	CancelWorkflowRun(ctx context.Context, owner, repo string, runID int64) error

	// Rate limiting.
	RateLimitRemaining() int
	RateLimitReset() time.Time
}

Client defines the interface for GitHub API operations.

func NewClient

func NewClient(log logrus.FieldLogger, token string) Client

NewClient creates a new GitHub client.

type ListWorkflowRunsOpts

type ListWorkflowRunsOpts struct {
	Branch    string
	Event     string
	Status    string
	CreatedAt *time.Time
	PerPage   int
}

ListWorkflowRunsOpts contains options for listing workflow runs.

type Metrics

type Metrics interface {
	SetGitHubRateLimit(remaining float64)
}

Metrics interface for rate limit tracking.

type Poller

type Poller interface {
	Start(ctx context.Context) error
	Stop() error
	ForceRefresh(ctx context.Context) error
	SetRunnerChangeCallback(cb RunnerChangeCallback)
}

Poller periodically fetches runner status from GitHub.

func NewPoller

func NewPoller(
	log logrus.FieldLogger,
	cfg *config.Config,
	client Client,
	st store.Store,
	m Metrics,
) Poller

NewPoller creates a new runner poller.

type Runner

type Runner struct {
	ID     int64
	Name   string
	OS     string
	Status string // online, offline
	Busy   bool
	Labels []string
}

Runner represents a GitHub Actions runner.

type RunnerChangeCallback

type RunnerChangeCallback func(runner *store.Runner)

RunnerChangeCallback is called when runner status changes.

type WorkflowJob

type WorkflowJob struct {
	ID         int64
	Name       string
	Status     string // queued, in_progress, completed
	Conclusion string // success, failure, cancelled, etc.
	RunnerID   int64
	RunnerName string
	StartedAt  time.Time
}

WorkflowJob represents a job within a GitHub Actions workflow run.

type WorkflowRun

type WorkflowRun struct {
	ID         int64
	Name       string
	Status     string // queued, in_progress, completed
	Conclusion string // success, failure, cancelled, etc.
	HTMLURL    string
	CreatedAt  time.Time
	UpdatedAt  time.Time
}

WorkflowRun represents a GitHub Actions workflow run.

Jump to

Keyboard shortcuts

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