Documentation ¶
Index ¶
- type Git
- func (vc *Git) BranchTags(branchName string) []string
- func (vc *Git) CreateTag(tag string) error
- func (vc *Git) DeleteTag(tag string) error
- func (vc *Git) ExistsTag(version string) (bool, error)
- func (vc *Git) HasStagedChanges() bool
- func (vc *Git) HasUncommittedChanges() (bool, error)
- func (vc *Git) IsBehind(ctx context.Context) (bool, error)
- func (vc *Git) IsSafe(ctx context.Context) error
- func (vc *Git) LatestCommitHash() string
- func (vc *Git) Push(ctx context.Context) error
- func (vc *Git) Tags() []string
- type NoOpRepository
- func (noop *NoOpRepository) BranchTags(branchName string) []string
- func (noop *NoOpRepository) CreateTag(tag string) error
- func (noop *NoOpRepository) DeleteTag(tag string) error
- func (noop *NoOpRepository) ExistsTag(version string) (bool, error)
- func (noop *NoOpRepository) IsSafe(ctx context.Context) error
- func (noop *NoOpRepository) LatestCommitHash() string
- func (noop *NoOpRepository) Push(ctx context.Context) error
- func (noop *NoOpRepository) Tags() []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Git ¶
type Git struct {
// contains filtered or unexported fields
}
Git is the version control client for git
func (*Git) BranchTags ¶
BranchTags lists all existing tags associated to commits of the given branch.
func (*Git) ExistsTag ¶
ExistsTag validates the parameter version and returns the existence of the git tag.
func (*Git) HasStagedChanges ¶
HasStagedChanges checks the git repo stash for staged changes Note: the current version of the go-git doesn't support this functionality.
func (*Git) HasUncommittedChanges ¶
HasUncommittedChanges checks the git repo for uncommitted changes.
func (*Git) IsBehind ¶
IsBehind checks the local repo with the origin and validate the state of the git repo
func (*Git) IsSafe ¶
IsSafe validate the state of the git repo and returns an error if the repo is unsafe like include uncommitted files or the local branch is behind the origin.
func (*Git) LatestCommitHash ¶
LatestCommitHash returns the latest commit hash of the git repo. In case of an error the result is empty.
type NoOpRepository ¶
type NoOpRepository struct{}
NoOpRepository is the implementation of an no-operation client.
func NewNoOp ¶
func NewNoOp() *NoOpRepository
NewNoOp creates an new instance of the No-Operation object
func (*NoOpRepository) BranchTags ¶
func (noop *NoOpRepository) BranchTags(branchName string) []string
BranchTags does nothing
func (*NoOpRepository) CreateTag ¶
func (noop *NoOpRepository) CreateTag(tag string) error
CreateTag does nothing.
func (*NoOpRepository) DeleteTag ¶
func (noop *NoOpRepository) DeleteTag(tag string) error
DeleteTag does nothing.
func (*NoOpRepository) ExistsTag ¶
func (noop *NoOpRepository) ExistsTag(version string) (bool, error)
ExistsTag does nothing.
func (*NoOpRepository) IsSafe ¶
func (noop *NoOpRepository) IsSafe(ctx context.Context) error
IsSafe does nothing.
func (*NoOpRepository) LatestCommitHash ¶
func (noop *NoOpRepository) LatestCommitHash() string
LatestCommitHash does nothing.