github

package
v0.0.0-...-0e571e4 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLicenseKey

func GetLicenseKey(ctx context.Context, name string) (string, error)

GetLicenseKey is the legacy function for backward compatibility Deprecated: Use Provider.GetLicenseKey instead

Types

type GitHubClient

type GitHubClient interface {
	GetRepository(ctx context.Context, owner, repo string) (*github.Repository, *github.Response, error)
}

GitHubClient is an interface for GitHub API operations (allows mocking)

type Provider

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

Provider implements the LicenseProvider interface for GitHub repositories

func NewProvider

func NewProvider() *Provider

NewProvider creates a new GitHub license provider

func NewProviderWithClient

func NewProviderWithClient(client GitHubClient) *Provider

NewProviderWithClient creates a provider with a custom client (for testing)

func (*Provider) GetLicense

func (p *Provider) GetLicense(ctx context.Context, importPath, version, branch, url string) (string, error)

GetLicense retrieves license information from GitHub API

func (*Provider) GetLicenseKey

func (p *Provider) GetLicenseKey(ctx context.Context, name string) (string, error)

GetLicenseKey retrieves the license key for a GitHub repository using the provider's client

func (*Provider) Name

func (p *Provider) Name() string

Name returns the name of this provider

func (*Provider) Supports

func (p *Provider) Supports(importPath string) bool

Supports returns true if the import path is from github.com

Jump to

Keyboard shortcuts

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