git

package
v0.29.2 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoGitRepository = errors.New("no git repository")
	ErrNoStagedFiles   = errors.New("no staged files")
)

Functions

This section is empty.

Types

type Author

type Author struct {
	Name  string
	Email string
}

type Commit

type Commit struct {
	Author
	Hash    string
	Message string
}

type CommitOptions added in v0.18.0

type CommitOptions struct {
	*GPGSigningInfo
}

CommitOptions contains options for making a commit.

type GPGSigningInfo added in v0.18.0

type GPGSigningInfo struct {
	KeyRingPath string
	Passphrase  string
	KeyID       string
}

GPGSigningInfo contains information for signing a commit.

type Git

type Git interface {
	Init(url, branch string) (bool, error)
	Clone(ctx context.Context, url, branch string, caBundle []byte) (bool, error)
	Write(path string, reader io.Reader) error
	Commit(message Commit, options ...Option) (string, error)
	Push(ctx context.Context, caBundle []byte) error
	Status() (bool, error)
	Head() (string, error)
	Path() string
}

Git is an interface for basic Git operations on a single branch of a remote repository.

type GpgSigningOption added in v0.18.0

type GpgSigningOption struct {
	*GPGSigningInfo
}

func (GpgSigningOption) ApplyToCommit added in v0.18.0

func (w GpgSigningOption) ApplyToCommit(in *CommitOptions)

type Option added in v0.18.0

type Option interface {
	// ApplyToCommit applies this configuration to a given commit option.
	ApplyToCommit(*CommitOptions)
}

Option is a some configuration that modifies options for a commit.

func WithGpgSigningOption added in v0.18.0

func WithGpgSigningOption(path, passphrase, keyID string) Option

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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