github

package
v0.0.0-...-48ec95b Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package github provides functionality for interacting with GitHub API specifically focused on managing GitHub Actions runners.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client implements GitHubClient interface for interacting with GitHub API.

func New

func New(conf ClientConfig) (*Client, error)

New creates a new GitHub client with the provided configuration. It returns an error if the client cannot be initialized.

func (*Client) Close

func (c *Client) Close() error

Close cleans up any resources used by the client. Currently, this is a no-op as there are no resources that need explicit cleanup, but the method is provided for interface compatibility and future-proofing.

func (*Client) GetRunnerByName

func (c *Client) GetRunnerByName(runnerName string) (*github.Runners, error)

GetRunnerByName retrieves GitHub runners that match the provided name in the configured organization.

func (*Client) GetRunnerRegistrationToken

func (c *Client) GetRunnerRegistrationToken() (*github.RegistrationToken, error)

GetRunnerRegistrationToken retrieves a registration token for GitHub Actions runners in the configured organization.

func (*Client) RemoveRunner

func (c *Client) RemoveRunner(runnerID int64) error

RemoveRunner removes a GitHub Actions runner by its ID from the configured organization.

type ClientConfig

type ClientConfig struct {
	// PrivateKeyFile is the path to the private key file
	PrivateKeyFile string
	// Organization is the GitHub organization name
	Organization string
	// PrivateKey contains the private key bytes for the GitHub App
	PrivateKey []byte
	// AppID is the GitHub App ID
	AppID int64
	// InstallationID is the GitHub App Installation ID
	InstallationID int64
}

ClientConfig contains the configuration needed to authenticate and interact with GitHub API.

type GitHubClient

type GitHubClient interface {
	// GetRunnerRegistrationToken retrieves a registration token for GitHub Actions runners.
	GetRunnerRegistrationToken(ctx context.Context) (*github.RegistrationToken, error)

	// GetRunnerByName retrieves GitHub runners by name.
	GetRunnerByName(ctx context.Context, runnerName string) (*github.Runners, error)

	// RemoveRunner removes a GitHub Actions runner by its ID.
	RemoveRunner(ctx context.Context, runnerID int64) error

	// Close cleans up any resources used by the client.
	Close() error
}

GitHubClient defines the interface for GitHub API operations related to GitHub Actions runners.

Jump to

Keyboard shortcuts

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