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 ¶
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. |
Click to show internal directories.
Click to hide internal directories.