Documentation
¶
Index ¶
- Constants
- Variables
- func AddWorktreeFilesToTar(tw *tar.Writer, gitRepo *git.Repository) error
- func CloneInMemory(url string, opts CloneOptions) (*git.Repository, error)
- func CredentialsPaths() []*framework.Path
- func DeleteGitCredential(ctx context.Context, storage logical.Storage) error
- func ForEachFile(billyFS billy.Filesystem, ...) error
- func ForEachWorktreeFile(gitRepo *git.Repository, ...) error
- func IsAncestor(gitRepo *git.Repository, ancestorCommit, descendantCommit string) (bool, error)
- func NewNotEnoughVerifiedPGPSignaturesError(number int) error
- func PutGitCredential(ctx context.Context, storage logical.Storage, gitCredential GitCredential) error
- func ReadWorktreeFile(gitRepo *git.Repository, path string) ([]byte, error)
- func VerifyCommitSignatures(repo *git.Repository, commit string, trustedPGPPublicKeys []string, ...) error
- func VerifyTagSignatures(repo *git.Repository, tagName string, trustedPGPPublicKeys []string, ...) error
- type CloneOptions
- type GitCredential
- type NotEnoughVerifiedPGPSignaturesError
Constants ¶
View Source
const ( FieldNameGitCredentialUsername = "username" FieldNameGitCredentialPassword = "password" StorageKeyConfigurationGitCredential = "configuration_git_credential" )
Variables ¶
View Source
var ErrCloneSizeLimitExceeded = errors.New("clone size limit exceeded")
ErrCloneSizeLimitExceeded is returned when the repository size exceeds MaxCloneSizeBytes during in-memory clone.
Functions ¶
func AddWorktreeFilesToTar ¶
func AddWorktreeFilesToTar(tw *tar.Writer, gitRepo *git.Repository) error
func CloneInMemory ¶
func CloneInMemory(url string, opts CloneOptions) (*git.Repository, error)
func CredentialsPaths ¶
func DeleteGitCredential ¶
func ForEachFile ¶ added in v0.2.0
func ForEachFile(billyFS billy.Filesystem, fileFunc func(path, link string, fileReader io.Reader, info os.FileInfo) error) error
ForEachFile walks all files in the given billy filesystem and calls fileFunc for each.
func ForEachWorktreeFile ¶
func IsAncestor ¶
func IsAncestor(gitRepo *git.Repository, ancestorCommit, descendantCommit string) (bool, error)
func PutGitCredential ¶
func ReadWorktreeFile ¶
func ReadWorktreeFile(gitRepo *git.Repository, path string) ([]byte, error)
func VerifyCommitSignatures ¶
func VerifyTagSignatures ¶
Types ¶
type CloneOptions ¶
type CloneOptions struct {
TagName string
BranchName string
ReferenceName string
RecurseSubmodules git.SubmoduleRecursivity
Auth transport.AuthMethod
CABundle []byte
// MaxCloneSizeBytes limits total size of objects stored during in-memory clone (0 = no limit).
// When exceeded, clone fails with ErrCloneSizeLimitExceeded. Use to prevent OOM on large or malicious repos.
MaxCloneSizeBytes int64
}
type GitCredential ¶
type GitCredential struct {
Username string `structs:"username" json:"username"`
Password string `structs:"password" json:"password"`
}
func GetGitCredential ¶
type NotEnoughVerifiedPGPSignaturesError ¶
type NotEnoughVerifiedPGPSignaturesError struct {
Number int
}
func (*NotEnoughVerifiedPGPSignaturesError) Error ¶
func (r *NotEnoughVerifiedPGPSignaturesError) Error() string
Click to show internal directories.
Click to hide internal directories.