git

package
v0.0.0-...-8652ae4 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2025 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RepoSpec

type RepoSpec struct {
	URL         string
	Credentials transport.AuthMethod
	Progress    io.Writer
	// contains filtered or unexported fields
}

func NewRepoSpec

func NewRepoSpec(url string, credentials transport.AuthMethod, opts ...RepoSpecOption) *RepoSpec

NewRepoSpec creates a new RepoSpec instance with the given URL and credentials. Optional functional options can be provided to configure the RepoSpec's behavior, such as adding tracing support.

func (*RepoSpec) Checkout

func (rs *RepoSpec) Checkout(ctx context.Context, reference plumbing.ReferenceName) (*git.Repository, string, error)

Checkout checks out a specific reference and returns the repository and directory. It creates a shallow clone of the reference to enable concurrent operations.

func (*RepoSpec) CloneDirectory

func (rs *RepoSpec) CloneDirectory(branch string) string

func (*RepoSpec) ListBranches

func (rs *RepoSpec) ListBranches(ctx context.Context) ([]*plumbing.Reference, error)

func (*RepoSpec) Name

func (rs *RepoSpec) Name() string

func (*RepoSpec) Open

func (rs *RepoSpec) Open(ctx context.Context) (*git.Repository, error)

Open opens the repository, cloning it if necessary. The repository is cached for subsequent calls.

func (*RepoSpec) ResolveRevion

func (rs *RepoSpec) ResolveRevion(ctx context.Context, ref string) (*plumbing.Hash, error)

type RepoSpecOption

type RepoSpecOption func(*RepoSpec)

RepoSpecOption is a functional option for configuring a RepoSpec.

func WithOtelTracer

func WithOtelTracer(tracer trace.Tracer) RepoSpecOption

WithOtelTracer configures the RepoSpec to use the provided OpenTelemetry tracer for instrumentation.

func WithTracer

func WithTracer(tracer *tracing.Tracer) RepoSpecOption

WithTracer configures the RepoSpec to use the provided tracer for instrumentation.

Jump to

Keyboard shortcuts

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