github

package
v0.0.0-...-6d0069c Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FetchManifestPath

func FetchManifestPath(ctx context.Context, client Client, owner, repo string) (string, error)

FetchManifestPath searches for the manifest.toml path in a repository.

func GetStarCount

func GetStarCount(ctx context.Context, client Client, c *cache.Cache, owner, repo string, noCache, debugMode bool) (int, error)

GetStarCount retrieves the star count for a repository, using the cache.

Types

type Client

type Client interface {
	SearchCode(ctx context.Context, query string, opts *gh.SearchOptions) (*gh.CodeSearchResult, *gh.Response, error)
	GetRepository(ctx context.Context, owner, repo string) (*gh.Repository, *gh.Response, error)
	IsOrgMember(ctx context.Context, org, user string) (bool, *gh.Response, error)
}

Client defines the GitHub API methods used by this application.

func NewClient

func NewClient(token string) Client

NewClient creates a new GitHub API client authenticated with the given token.

type MembershipCache

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

MembershipCache caches GitHub org membership lookups.

func NewMembershipCache

func NewMembershipCache() *MembershipCache

NewMembershipCache creates a new MembershipCache.

func (*MembershipCache) Check

func (mc *MembershipCache) Check(ctx context.Context, client Client, username, org string) (bool, error)

Check returns whether the user is a member of the org, using the cache.

type Repo

type Repo struct {
	Owner string
	Name  string
	Stars int
}

Repo represents a GitHub repository with optional star count.

func FindManifestRepos

func FindManifestRepos(ctx context.Context, client Client, c *cache.Cache, mc *MembershipCache, opts SearchOptions) ([]Repo, error)

FindManifestRepos searches for repositories containing .flox/env/manifest.toml.

func FindReadmeRepos

func FindReadmeRepos(ctx context.Context, client Client, c *cache.Cache, mc *MembershipCache, opts SearchOptions) ([]Repo, error)

FindReadmeRepos searches for repositories containing "flox install" in their README.

func (Repo) FullName

func (r Repo) FullName() string

FullName returns the "owner/name" form.

type RepoInfo

type RepoInfo struct {
	Date       string `json:"date"`
	Repository string `json:"repository"`
	Type       string `json:"type"`
	StarCount  int    `json:"starcount"`
}

RepoInfo holds repository information for JSON export.

type SearchOptions

type SearchOptions struct {
	ShowFull  bool
	NoCache   bool
	DebugMode bool
}

SearchOptions controls the behavior of repository search functions.

Jump to

Keyboard shortcuts

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