Documentation ¶
Overview ¶
Package core is a generated GoMock package.
Package core is a generated GoMock package.
Package core is a generated GoMock package.
Index ¶
- type CalculateCommandBuilder
- func (b *CalculateCommandBuilder) Build() Command
- func (b *CalculateCommandBuilder) SetAddFloatingTags(addFloatingTags bool) *CalculateCommandBuilder
- func (b *CalculateCommandBuilder) SetPath(path string) *CalculateCommandBuilder
- func (b *CalculateCommandBuilder) SetPush(push bool) *CalculateCommandBuilder
- func (b *CalculateCommandBuilder) SetScm(scm Scm) *CalculateCommandBuilder
- type CalculateCommandImpl
- type CalculateOutput
- type Command
- type CommitLog
- type GitRepo
- type GitRepoImpl
- func (g *GitRepoImpl) CommitObject(hash plumbing.Hash) (*object.Commit, error)
- func (g *GitRepoImpl) CreateTag(name string, hash plumbing.Hash, opts *git.CreateTagOptions) (*plumbing.Reference, error)
- func (g *GitRepoImpl) DeleteTag(name string) error
- func (g *GitRepoImpl) Head() (*plumbing.Reference, error)
- func (g *GitRepoImpl) Log(options *git.LogOptions) (object.CommitIter, error)
- func (g *GitRepoImpl) PlainOpen(path string) error
- func (g *GitRepoImpl) Push(opts *git.PushOptions) error
- func (g *GitRepoImpl) Tags() (storer.ReferenceIter, error)
- type MockCommitIter
- type MockCommitIterMockRecorder
- type MockGitRepo
- func (m *MockGitRepo) CommitObject(arg0 plumbing.Hash) (*object.Commit, error)
- func (m *MockGitRepo) CreateTag(name string, hash plumbing.Hash, opts *v5.CreateTagOptions) (*plumbing.Reference, error)
- func (m *MockGitRepo) DeleteTag(name string) error
- func (m *MockGitRepo) EXPECT() *MockGitRepoMockRecorder
- func (m *MockGitRepo) Head() (*plumbing.Reference, error)
- func (m *MockGitRepo) Log(arg0 *v5.LogOptions) (object.CommitIter, error)
- func (m *MockGitRepo) PlainOpen(arg0 string) error
- func (m *MockGitRepo) Push(opts *v5.PushOptions) error
- func (m *MockGitRepo) Tags() (storer.ReferenceIter, error)
- type MockGitRepoMockRecorder
- func (mr *MockGitRepoMockRecorder) CommitObject(arg0 interface{}) *gomock.Call
- func (mr *MockGitRepoMockRecorder) CreateTag(name, hash, opts interface{}) *gomock.Call
- func (mr *MockGitRepoMockRecorder) DeleteTag(name interface{}) *gomock.Call
- func (mr *MockGitRepoMockRecorder) Head() *gomock.Call
- func (mr *MockGitRepoMockRecorder) Log(arg0 interface{}) *gomock.Call
- func (mr *MockGitRepoMockRecorder) PlainOpen(arg0 interface{}) *gomock.Call
- func (mr *MockGitRepoMockRecorder) Push(opts interface{}) *gomock.Call
- func (mr *MockGitRepoMockRecorder) Tags() *gomock.Call
- type MockReferenceIter
- type MockReferenceIterMockRecorder
- type MockScm
- type MockScmMockRecorder
- type Scm
- type ScmGit
- type ScmGitBuilder
- type SemanticVersionComponent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CalculateCommandBuilder ¶
CalculateCommand is an interface for the CalculateCommandImpl.
func NewCalculateCommandBuilder ¶
func NewCalculateCommandBuilder() *CalculateCommandBuilder
NewCalculateCommandBuilder creates a new instance of CalculateCommandBuilder. It returns a pointer to the newly created CalculateCommandBuilder.
func (*CalculateCommandBuilder) Build ¶
func (b *CalculateCommandBuilder) Build() Command
Build returns a Command built from the CalculateCommandBuilder. It creates a CalculateCommandImpl with the provided Scm.
func (*CalculateCommandBuilder) SetAddFloatingTags ¶ added in v1.2.0
func (b *CalculateCommandBuilder) SetAddFloatingTags(addFloatingTags bool) *CalculateCommandBuilder
SetAddFloatingTags sets the AddFloatingTags field of the CalculateCommandBuilder. It takes a boolean parameter 'addFloatingTags' and assigns it to the 'AddFloatingTags' field of the CalculateCommandBuilder. It returns a pointer to the CalculateCommandBuilder for method chaining.
func (*CalculateCommandBuilder) SetPath ¶
func (b *CalculateCommandBuilder) SetPath(path string) *CalculateCommandBuilder
SetPath sets the path for the CalculateCommandBuilder. It takes a string parameter 'path' and assigns it to the 'Path' field of the CalculateCommandBuilder. It returns a pointer to the CalculateCommandBuilder for method chaining.
func (*CalculateCommandBuilder) SetPush ¶ added in v1.2.0
func (b *CalculateCommandBuilder) SetPush(push bool) *CalculateCommandBuilder
SetPush sets the Push field of the CalculateCommandBuilder. It takes a boolean parameter 'push' and assigns it to the 'Push' field of the CalculateCommandBuilder. It returns a pointer to the CalculateCommandBuilder for method chaining.
func (*CalculateCommandBuilder) SetScm ¶
func (b *CalculateCommandBuilder) SetScm(scm Scm) *CalculateCommandBuilder
SetScm sets the source control management (SCM) for the CalculateCommandBuilder. It takes an Scm parameter and returns a pointer to the CalculateCommandBuilder.
type CalculateCommandImpl ¶
CalculateCommandImpl represents an implementation of the CalculateCommand interface. It contains a Command and Scm field.
func (*CalculateCommandImpl) Execute ¶
func (c *CalculateCommandImpl) Execute() (interface{}, error)
Execute executes the CalculateCommandImpl command and returns the next version tag string and any error encountered.
func (*CalculateCommandImpl) GetGreatestTag ¶ added in v0.4.0
func (c *CalculateCommandImpl) GetGreatestTag(nextTag semver.Version, tags []*semver.Version) semver.Version
type CalculateOutput ¶ added in v1.2.0
type Command ¶
type Command interface {
Execute() (interface{}, error)
}
Command is an interface that represents a command. It defines the Execute method, which executes the command and returns a string and an error.
type CommitLog ¶
type CommitLog struct { Hash string // The commit hash. Tags []*semver.Version // The tags associated with the commit. Message string // The commit message. Date time.Time // The commit date. Author string // The author of the commit. Head bool // Indicates if the commit is the HEAD commit. BranchName string // The name of the branch the commit belongs to. }
CommitLog represents a commit in the Git repository.
type GitRepo ¶
type GitRepo interface { PlainOpen(string) error Head() (*plumbing.Reference, error) Log(*git.LogOptions) (object.CommitIter, error) Tags() (storer.ReferenceIter, error) CommitObject(plumbing.Hash) (*object.Commit, error) CreateTag(name string, hash plumbing.Hash, opts *git.CreateTagOptions) (*plumbing.Reference, error) DeleteTag(name string) error Push(opts *git.PushOptions) error }
GitRepo is an interface that defines the methods for interacting with a Git repository.
type GitRepoImpl ¶
type GitRepoImpl struct {
// contains filtered or unexported fields
}
GitRepoImpl is an implementation of the GitRepo interface.
func (*GitRepoImpl) CommitObject ¶
CommitObject returns the commit object with the given hash.
func (*GitRepoImpl) CreateTag ¶ added in v1.2.0
func (g *GitRepoImpl) CreateTag(name string, hash plumbing.Hash, opts *git.CreateTagOptions) (*plumbing.Reference, error)
CreateTag creates a new tag with the given name and hash in the Git repository. It returns a reference to the newly created tag and any error encountered.
func (*GitRepoImpl) DeleteTag ¶ added in v1.2.0
func (g *GitRepoImpl) DeleteTag(name string) error
DeleteTag deletes the tag with the given name from the Git repository. It returns an error if the tag deletion fails.
func (*GitRepoImpl) Head ¶
func (g *GitRepoImpl) Head() (*plumbing.Reference, error)
Head returns the reference to the HEAD commit in the Git repository.
func (*GitRepoImpl) Log ¶
func (g *GitRepoImpl) Log(options *git.LogOptions) (object.CommitIter, error)
Log returns a commit iterator for the Git repository, based on the provided options. It retrieves the commit history of the repository. The returned commit iterator can be used to iterate over the commits in the repository. The options parameter allows specifying various options for filtering and sorting the commit history. It returns the commit iterator and an error if any occurred.
func (*GitRepoImpl) PlainOpen ¶
func (g *GitRepoImpl) PlainOpen(path string) error
PlainOpen opens a Git repository at the specified path. It initializes the GitRepoImpl struct with the opened repository. Returns an error if the repository cannot be opened.
func (*GitRepoImpl) Push ¶ added in v1.2.0
func (g *GitRepoImpl) Push(opts *git.PushOptions) error
Push pushes the changes to the remote repository.
func (*GitRepoImpl) Tags ¶
func (g *GitRepoImpl) Tags() (storer.ReferenceIter, error)
Tags returns an iterator over the tags in the Git repository. It returns a storer.ReferenceIter that can be used to iterate over the tags. If an error occurs, it is returned along with the iterator.
type MockCommitIter ¶
type MockCommitIter struct {
// contains filtered or unexported fields
}
MockCommitIter is a mock of CommitIter interface.
func NewMockCommitIter ¶
func NewMockCommitIter(ctrl *gomock.Controller) *MockCommitIter
NewMockCommitIter creates a new mock instance.
func (*MockCommitIter) EXPECT ¶
func (m *MockCommitIter) EXPECT() *MockCommitIterMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockCommitIterMockRecorder ¶
type MockCommitIterMockRecorder struct {
// contains filtered or unexported fields
}
MockCommitIterMockRecorder is the mock recorder for MockCommitIter.
func (*MockCommitIterMockRecorder) Close ¶
func (mr *MockCommitIterMockRecorder) Close() *gomock.Call
Close indicates an expected call of Close.
func (*MockCommitIterMockRecorder) ForEach ¶
func (mr *MockCommitIterMockRecorder) ForEach(arg0 interface{}) *gomock.Call
ForEach indicates an expected call of ForEach.
func (*MockCommitIterMockRecorder) Next ¶
func (mr *MockCommitIterMockRecorder) Next() *gomock.Call
Next indicates an expected call of Next.
type MockGitRepo ¶
type MockGitRepo struct {
// contains filtered or unexported fields
}
MockGitRepo is a mock of GitRepo interface.
func NewMockGitRepo ¶
func NewMockGitRepo(ctrl *gomock.Controller) *MockGitRepo
NewMockGitRepo creates a new mock instance.
func (*MockGitRepo) CommitObject ¶
CommitObject mocks base method.
func (*MockGitRepo) CreateTag ¶ added in v1.2.0
func (m *MockGitRepo) CreateTag(name string, hash plumbing.Hash, opts *v5.CreateTagOptions) (*plumbing.Reference, error)
CreateTag mocks base method.
func (*MockGitRepo) DeleteTag ¶ added in v1.2.0
func (m *MockGitRepo) DeleteTag(name string) error
DeleteTag mocks base method.
func (*MockGitRepo) EXPECT ¶
func (m *MockGitRepo) EXPECT() *MockGitRepoMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockGitRepo) Head ¶
func (m *MockGitRepo) Head() (*plumbing.Reference, error)
Head mocks base method.
func (*MockGitRepo) Log ¶
func (m *MockGitRepo) Log(arg0 *v5.LogOptions) (object.CommitIter, error)
Log mocks base method.
func (*MockGitRepo) PlainOpen ¶
func (m *MockGitRepo) PlainOpen(arg0 string) error
PlainOpen mocks base method.
func (*MockGitRepo) Push ¶ added in v1.2.0
func (m *MockGitRepo) Push(opts *v5.PushOptions) error
Push mocks base method.
func (*MockGitRepo) Tags ¶
func (m *MockGitRepo) Tags() (storer.ReferenceIter, error)
Tags mocks base method.
type MockGitRepoMockRecorder ¶
type MockGitRepoMockRecorder struct {
// contains filtered or unexported fields
}
MockGitRepoMockRecorder is the mock recorder for MockGitRepo.
func (*MockGitRepoMockRecorder) CommitObject ¶
func (mr *MockGitRepoMockRecorder) CommitObject(arg0 interface{}) *gomock.Call
CommitObject indicates an expected call of CommitObject.
func (*MockGitRepoMockRecorder) CreateTag ¶ added in v1.2.0
func (mr *MockGitRepoMockRecorder) CreateTag(name, hash, opts interface{}) *gomock.Call
CreateTag indicates an expected call of CreateTag.
func (*MockGitRepoMockRecorder) DeleteTag ¶ added in v1.2.0
func (mr *MockGitRepoMockRecorder) DeleteTag(name interface{}) *gomock.Call
DeleteTag indicates an expected call of DeleteTag.
func (*MockGitRepoMockRecorder) Head ¶
func (mr *MockGitRepoMockRecorder) Head() *gomock.Call
Head indicates an expected call of Head.
func (*MockGitRepoMockRecorder) Log ¶
func (mr *MockGitRepoMockRecorder) Log(arg0 interface{}) *gomock.Call
Log indicates an expected call of Log.
func (*MockGitRepoMockRecorder) PlainOpen ¶
func (mr *MockGitRepoMockRecorder) PlainOpen(arg0 interface{}) *gomock.Call
PlainOpen indicates an expected call of PlainOpen.
func (*MockGitRepoMockRecorder) Push ¶ added in v1.2.0
func (mr *MockGitRepoMockRecorder) Push(opts interface{}) *gomock.Call
Push indicates an expected call of Push.
func (*MockGitRepoMockRecorder) Tags ¶
func (mr *MockGitRepoMockRecorder) Tags() *gomock.Call
Tags indicates an expected call of Tags.
type MockReferenceIter ¶
type MockReferenceIter struct {
// contains filtered or unexported fields
}
MockReferenceIter is a mock of ReferenceIter interface.
func NewMockReferenceIter ¶
func NewMockReferenceIter(ctrl *gomock.Controller) *MockReferenceIter
NewMockReferenceIter creates a new mock instance.
func (*MockReferenceIter) EXPECT ¶
func (m *MockReferenceIter) EXPECT() *MockReferenceIterMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockReferenceIterMockRecorder ¶
type MockReferenceIterMockRecorder struct {
// contains filtered or unexported fields
}
MockReferenceIterMockRecorder is the mock recorder for MockReferenceIter.
func (*MockReferenceIterMockRecorder) Close ¶
func (mr *MockReferenceIterMockRecorder) Close() *gomock.Call
Close indicates an expected call of Close.
func (*MockReferenceIterMockRecorder) ForEach ¶
func (mr *MockReferenceIterMockRecorder) ForEach(arg0 interface{}) *gomock.Call
ForEach indicates an expected call of ForEach.
func (*MockReferenceIterMockRecorder) Next ¶
func (mr *MockReferenceIterMockRecorder) Next() *gomock.Call
Next indicates an expected call of Next.
type MockScm ¶
type MockScm struct {
// contains filtered or unexported fields
}
MockScm is a mock of Scm interface.
func NewMockScm ¶
func NewMockScm(ctrl *gomock.Controller) *MockScm
NewMockScm creates a new mock instance.
func (*MockScm) EXPECT ¶
func (m *MockScm) EXPECT() *MockScmMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockScm) GetCommitLog ¶
GetCommitLog mocks base method.
type MockScmMockRecorder ¶
type MockScmMockRecorder struct {
// contains filtered or unexported fields
}
MockScmMockRecorder is the mock recorder for MockScm.
func (*MockScmMockRecorder) GetCommitLog ¶
func (mr *MockScmMockRecorder) GetCommitLog() *gomock.Call
GetCommitLog indicates an expected call of GetCommitLog.
func (*MockScmMockRecorder) Push ¶ added in v1.2.0
func (mr *MockScmMockRecorder) Push() *gomock.Call
Push indicates an expected call of Push.
func (*MockScmMockRecorder) Tag ¶ added in v1.2.0
func (mr *MockScmMockRecorder) Tag(name, hash, floating interface{}) *gomock.Call
Tag indicates an expected call of Tag.
type Scm ¶
type Scm interface { GetCommitLog() ([]*CommitLog, error) // GetCommitLog retrieves the commit history of the Git repository. Tag(name, hash string, floating bool) error Push() error }
Scm is an interface that defines the methods for interacting with a source control management system.
type ScmGit ¶
ScmGit is an implementation of the Scm interface for Git repositories.
func (*ScmGit) GetCommitLog ¶
GetCommitLog retrieves the commit history of the Git repository. It returns a slice of CommitLog structs representing each commit, along with associated information such as the commit hash, message, tags, author, and date. If an error occurs during the retrieval process, it is returned as the second value.
type ScmGitBuilder ¶
ScmGitBuilder is a builder for creating ScmGit instances.
func NewScmGitBuilder ¶
func NewScmGitBuilder() *ScmGitBuilder
NewScmGitBuilder creates a new ScmGitBuilder instance.
func (*ScmGitBuilder) Build ¶
func (b *ScmGitBuilder) Build() Scm
Build creates a new Scm instance based on the builder configuration.
func (*ScmGitBuilder) SetPath ¶
func (b *ScmGitBuilder) SetPath(path string) *ScmGitBuilder
SetPath sets the path of the Git repository.
func (*ScmGitBuilder) SetRepo ¶
func (b *ScmGitBuilder) SetRepo(repo GitRepo) *ScmGitBuilder
SetRepo sets the Git repository implementation.
type SemanticVersionComponent ¶ added in v0.5.0
type SemanticVersionComponent int
const ( MAJOR SemanticVersionComponent = iota MINOR PATCH )
func GetVersionUpdate ¶ added in v0.5.0
func GetVersionUpdate(commitMessage string) SemanticVersionComponent
GetVersionUpdate determines the version update type (MAJOR, MINOR, PATCH) based on the conventional commit message.