git

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2026 License: MIT Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct{}

Client represents a Git client using go-git

func New

func New() *Client

New creates a new Git client

func (*Client) CloneRepository

func (c *Client) CloneRepository(ctx context.Context, repoURL string) (*git.Repository, error)

CloneRepository clones a repository to memory for more advanced operations

func (*Client) FilterTags

func (c *Client) FilterTags(tags []string, pattern string) []string

FilterTags filters tags based on a pattern

func (*Client) FilterTagsWithPrefix

func (c *Client) FilterTagsWithPrefix(tags []string, prefix string) []string

FilterTagsWithPrefix filters tags that start with a specific prefix

func (*Client) GetCommitFromClone

func (c *Client) GetCommitFromClone(ctx context.Context, repoURL, commitSHA string) (*object.Commit, error)

GetCommitFromClone gets detailed commit information by cloning the repository

func (*Client) GetCommitInfo

func (c *Client) GetCommitInfo(ctx context.Context, repoURL, commitSHA string) (*CommitInfo, error)

GetCommitInfo gets information about a commit

func (*Client) GetCommitSHAForTag

func (c *Client) GetCommitSHAForTag(ctx context.Context, repoURL, tag string) (string, error)

GetCommitSHAForTag gets the commit SHA for a specific tag

func (*Client) GetDefaultBranch

func (c *Client) GetDefaultBranch(ctx context.Context, repoURL string) (string, error)

GetDefaultBranch gets the default branch of the repository

func (*Client) GetFirstValidTag

func (c *Client) GetFirstValidTag(ctx context.Context, repoURL string, filter types.VersionFilterFunc) (string, error)

GetFirstValidTag finds the first tag that passes all filtering criteria

func (*Client) GetLatestTag

func (c *Client) GetLatestTag(ctx context.Context, repoURL string) (string, error)

GetLatestTag returns the latest tag from a Git repository

func (*Client) GetLatestTagWithFilter

func (c *Client) GetLatestTagWithFilter(ctx context.Context, repoURL, filter string) (string, error)

GetLatestTagWithFilter returns the latest tag that matches the filter

func (*Client) GetTagInfo

func (c *Client) GetTagInfo(ctx context.Context, repoURL, tagName string) (*TagInfo, error)

GetTagInfo gets detailed information about a tag

func (*Client) GetTags

func (c *Client) GetTags(ctx context.Context, repoURL string) ([]string, error)

GetTags returns all tags from a Git repository

func (*Client) GetTagsWithFilter

func (c *Client) GetTagsWithFilter(ctx context.Context, repoURL, filterPrefix, filterContains string) ([]string, error)

GetTagsWithFilter returns filtered tags from a Git repository with early termination

func (*Client) ListBranches

func (c *Client) ListBranches(ctx context.Context, repoURL string) ([]string, error)

ListBranches lists all branches in the repository

func (*Client) VerifyCommitExists

func (c *Client) VerifyCommitExists(ctx context.Context, repoURL, commitSHA string) (bool, error)

VerifyCommitExists verifies that a commit SHA exists in the repository

type CommitInfo

type CommitInfo struct {
	SHA        string
	Repository string
	Message    string
	Author     string
	Date       string
}

CommitInfo represents information about a Git commit

type Repository

type Repository struct {
	URL    string
	Branch string
}

Repository represents a Git repository

type TagInfo

type TagInfo struct {
	Name       string
	SHA        string
	Message    string
	Tagger     string
	TaggerDate string
}

TagInfo represents information about a Git tag

Jump to

Keyboard shortcuts

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