git

package
v0.0.43 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package git builds the GitClient from config: the stub (the default) or the git binary run through a CommandRunner (exec), run through the client tier (Decorate).

Index

Constants

View Source
const (
	// KindStub touches nothing (the default).
	KindStub client.Kind = "stub"

	// KindExec runs the git binary.
	KindExec client.Kind = "exec"
)

Variables

This section is empty.

Functions

func Decorate

func Decorate(
	base interfaces.GitClient,
	decs decorate.Decorations,
	name string,
	opts ...client.Option,
) (interfaces.GitClient, error)

Decorate runs every GitClient operation of base through the client tier as the client named name. StageFiles, Move and Remove write the index and tree, so they run once; the rest are reads.

func NewFromConfig

func NewFromConfig(
	ctx context.Context,
	cfg Config,
	deps Deps,
) (interfaces.GitClient, error)

NewFromConfig builds the git client cfg.Kind selects and runs it through the client tier. An unknown kind, or exec without a runner, is CodeInvalidInput.

Types

type Config

type Config struct {
	// Kind selects the backend; empty means KindStub.
	Kind client.Kind `yaml:"kind" mapstructure:"kind"`

	// Name labels the client in decoration overrides, metrics, spans and logs; empty
	// uses the family name ("git").
	Name string `yaml:"name" mapstructure:"name"`
}

Config selects the git client.

type Deps

type Deps struct {
	// Decorations decorates the client and supplies its observability.
	decorate.Decorations

	// Runner runs git for KindExec.
	Runner interfaces.CommandRunner
}

Deps carries the git client's collaborators.

Directories

Path Synopsis
Package exec is the GitClient that runs the git binary through a CommandRunner.
Package exec is the GitClient that runs the git binary through a CommandRunner.
Package stub is the GitClient that touches nothing: every listing is empty, nothing has changed, and no directory is a repository.
Package stub is the GitClient that touches nothing: every listing is empty, nothing has changed, and no directory is a repository.

Jump to

Keyboard shortcuts

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