github

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsGitHubURL

func IsGitHubURL(url string) bool

IsGitHubURL checks if a URL is a GitHub URL

func LoadConfigFromGitHubOrFile

func LoadConfigFromGitHubOrFile(path string) (io.Reader, error)

LoadConfigFromGitHubOrFile loads configuration from either a GitHub URL or local file

func LoadGitHubConfig

func LoadGitHubConfig(githubURL string) ([]byte, error)

LoadGitHubConfig loads a configuration file from GitHub

Types

type Fetcher

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

Fetcher fetches OpenAPI schemas from GitHub repositories

func NewFetcher

func NewFetcher(logger *slog.Logger) *Fetcher

NewFetcher creates a new GitHub schema fetcher

func (*Fetcher) Fetch

func (f *Fetcher) Fetch(ctx context.Context, source string) (domain.APISchema, error)

Fetch retrieves a schema from a GitHub repository

func (*Fetcher) FetchWithConfig

func (f *Fetcher) FetchWithConfig(ctx context.Context, config usecase.SchemaSourceConfig) (domain.APISchema, error)

FetchWithConfig retrieves a schema with additional configuration

type GHClient

type GHClient struct{}

GHClient wraps the gh CLI command for GitHub operations

func NewGHClient

func NewGHClient() *GHClient

NewGHClient creates a new GitHub client

func (*GHClient) FetchFile

func (c *GHClient) FetchFile(ctx context.Context, githubURL string) ([]byte, error)

FetchFile retrieves a file from GitHub using the gh CLI

func (*GHClient) FetchFileRaw

func (c *GHClient) FetchFileRaw(ctx context.Context, githubURL string) ([]byte, error)

FetchFileRaw retrieves a file from GitHub using the raw content endpoint

Jump to

Keyboard shortcuts

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