git2goutil

package
v15.5.9 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateCommitSignature added in v15.4.0

func CreateCommitSignature(signingKeyPath, contentToSign string) (string, error)

CreateCommitSignature reads the given signing key and produces PKCS#7 detached signature. When the path to the signing key is not present, an empty signature is returned.

func OpenRepository

func OpenRepository(path string) (*git.Repository, error)

OpenRepository opens the repository located at path as a Git2Go repository.

Types

type CommitSubmitter added in v15.4.0

type CommitSubmitter struct {
	Repo           *git.Repository
	SigningKeyPath string
}

CommitSubmitter is the helper struct to make signed Commits conveniently.

func NewCommitSubmitter added in v15.4.0

func NewCommitSubmitter(repo *git.Repository, signingKeyPath string) *CommitSubmitter

NewCommitSubmitter creates a new CommitSubmitter.

func (*CommitSubmitter) Commit added in v15.4.0

func (cs *CommitSubmitter) Commit(
	author, committer *git.Signature,
	messageEncoding git.MessageEncoding,
	message string,
	tree *git.Tree,
	parents ...*git.Commit,
) (*git.Oid, error)

Commit commits a commit with or without OpenPGP signature depends on SigningKeyPath value.

Jump to

Keyboard shortcuts

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