github

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2026 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package github provides a GitHub provider for the OpenCTEM SDK.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CodeScanningCollector

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

CodeScanningCollector collects code scanning alerts from GitHub.

func NewCodeScanningCollector

func NewCodeScanningCollector(connector *github.Connector, verbose bool) *CodeScanningCollector

NewCodeScanningCollector creates a new code scanning collector.

func (*CodeScanningCollector) Collect

func (*CodeScanningCollector) Name

func (c *CodeScanningCollector) Name() string

func (*CodeScanningCollector) TestConnection

func (c *CodeScanningCollector) TestConnection(ctx context.Context) error

func (*CodeScanningCollector) Type

func (c *CodeScanningCollector) Type() string

type Config

type Config struct {
	// Token is the GitHub personal access token.
	Token string `yaml:"token" json:"token"`

	// Organization to scope operations to.
	Organization string `yaml:"organization" json:"organization"`

	// BaseURL for GitHub API (default: https://api.github.com).
	BaseURL string `yaml:"base_url" json:"base_url"`

	// RateLimit in requests per hour.
	RateLimit int `yaml:"rate_limit" json:"rate_limit"`

	// EnabledCollectors specifies which collectors to enable (empty = all).
	EnabledCollectors []string `yaml:"enabled_collectors" json:"enabled_collectors"`

	// Verbose enables debug logging.
	Verbose bool `yaml:"verbose" json:"verbose"`
}

Config holds GitHub provider configuration.

type DependabotCollector

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

DependabotCollector collects Dependabot alerts from GitHub.

func NewDependabotCollector

func NewDependabotCollector(connector *github.Connector, verbose bool) *DependabotCollector

NewDependabotCollector creates a new Dependabot collector.

func (*DependabotCollector) Collect

func (*DependabotCollector) Name

func (c *DependabotCollector) Name() string

func (*DependabotCollector) TestConnection

func (c *DependabotCollector) TestConnection(ctx context.Context) error

func (*DependabotCollector) Type

func (c *DependabotCollector) Type() string

type Provider

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

Provider is a complete GitHub integration bundle.

func NewProvider

func NewProvider(cfg *Config) *Provider

NewProvider creates a new GitHub provider.

func (*Provider) Close

func (p *Provider) Close() error

Close closes the provider.

func (*Provider) Connector

func (p *Provider) Connector() core.Connector

Connector returns the underlying connector.

func (*Provider) GetCollector

func (p *Provider) GetCollector(name string) (core.Collector, error)

GetCollector returns a specific collector by name.

func (*Provider) Initialize

func (p *Provider) Initialize(ctx context.Context, config *core.ProviderConfig) error

Initialize sets up the provider.

func (*Provider) ListCollectors

func (p *Provider) ListCollectors() []core.Collector

ListCollectors returns all available collectors.

func (*Provider) Name

func (p *Provider) Name() string

Name returns the provider name.

func (*Provider) TestConnection

func (p *Provider) TestConnection(ctx context.Context) error

TestConnection tests the provider connection.

type RepoCollector

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

RepoCollector collects repository information from GitHub.

func NewRepoCollector

func NewRepoCollector(connector *github.Connector, verbose bool) *RepoCollector

NewRepoCollector creates a new repo collector.

func (*RepoCollector) Collect

func (*RepoCollector) Name

func (c *RepoCollector) Name() string

func (*RepoCollector) TestConnection

func (c *RepoCollector) TestConnection(ctx context.Context) error

func (*RepoCollector) Type

func (c *RepoCollector) Type() string

Jump to

Keyboard shortcuts

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