Documentation
¶
Index ¶
- Variables
- func DeleteTag(name string) error
- func ListTags(pattern string) ([]string, error)
- func Register(cfg *Config)
- func ResetTagManager()
- type Config
- type OSGitTagOperations
- func (g *OSGitTagOperations) CreateAnnotatedTag(name, message string) error
- func (g *OSGitTagOperations) CreateLightweightTag(name string) error
- func (g *OSGitTagOperations) GetLatestTag() (string, error)
- func (g *OSGitTagOperations) PushTag(name string) error
- func (g *OSGitTagOperations) TagExists(name string) (bool, error)
- type TagManager
- type TagManagerPlugin
- func (p *TagManagerPlugin) CreateTag(version semver.SemVersion, message string) error
- func (p *TagManagerPlugin) Description() string
- func (p *TagManagerPlugin) FormatTagName(version semver.SemVersion) string
- func (p *TagManagerPlugin) GetConfig() *Config
- func (p *TagManagerPlugin) GetLatestTag() (semver.SemVersion, error)
- func (p *TagManagerPlugin) IsEnabled() bool
- func (p *TagManagerPlugin) Name() string
- func (p *TagManagerPlugin) TagExists(version semver.SemVersion) (bool, error)
- func (p *TagManagerPlugin) ValidateTagAvailable(version semver.SemVersion) error
- func (p *TagManagerPlugin) Version() string
Constants ¶
This section is empty.
Variables ¶
var ( RegisterTagManagerFn = registerTagManager GetTagManagerFn = getTagManager )
Functions ¶
func Register ¶
func Register(cfg *Config)
Register registers the tag manager plugin with the given configuration.
func ResetTagManager ¶
func ResetTagManager()
ResetTagManager clears the registered tag manager (for testing).
Types ¶
type Config ¶
type Config struct {
// Enabled controls whether the plugin is active.
Enabled bool
// AutoCreate automatically creates tags after version bumps.
AutoCreate bool
// Prefix is the tag prefix (default: "v").
Prefix string
// Annotate creates annotated tags instead of lightweight tags.
Annotate bool
// Push automatically pushes tags to remote after creation.
Push bool
}
Config holds configuration for the tag manager plugin.
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig returns the default tag manager configuration.
type OSGitTagOperations ¶
type OSGitTagOperations struct {
// contains filtered or unexported fields
}
OSGitTagOperations implements core.GitTagOperations using actual git commands.
func NewOSGitTagOperations ¶
func NewOSGitTagOperations() *OSGitTagOperations
NewOSGitTagOperations creates a new OSGitTagOperations with the default exec.Command.
func (*OSGitTagOperations) CreateAnnotatedTag ¶
func (g *OSGitTagOperations) CreateAnnotatedTag(name, message string) error
func (*OSGitTagOperations) CreateLightweightTag ¶
func (g *OSGitTagOperations) CreateLightweightTag(name string) error
func (*OSGitTagOperations) GetLatestTag ¶
func (g *OSGitTagOperations) GetLatestTag() (string, error)
func (*OSGitTagOperations) PushTag ¶
func (g *OSGitTagOperations) PushTag(name string) error
type TagManager ¶
type TagManager interface {
Name() string
Description() string
Version() string
// CreateTag creates a git tag for the given version.
CreateTag(version semver.SemVersion, message string) error
// TagExists checks if a tag for the given version already exists.
TagExists(version semver.SemVersion) (bool, error)
// GetLatestTag returns the latest semver tag from git.
GetLatestTag() (semver.SemVersion, error)
// ValidateTagAvailable ensures a tag can be created for the version.
ValidateTagAvailable(version semver.SemVersion) error
// FormatTagName formats a version as a tag name.
FormatTagName(version semver.SemVersion) string
}
TagManager defines the interface for git tag operations.
type TagManagerPlugin ¶
type TagManagerPlugin struct {
// contains filtered or unexported fields
}
TagManagerPlugin implements the TagManager interface.
func NewTagManager ¶
func NewTagManager(cfg *Config) *TagManagerPlugin
NewTagManager creates a new tag manager plugin with the given configuration.
func (*TagManagerPlugin) CreateTag ¶
func (p *TagManagerPlugin) CreateTag(version semver.SemVersion, message string) error
CreateTag creates a git tag for the given version.
func (*TagManagerPlugin) Description ¶
func (p *TagManagerPlugin) Description() string
func (*TagManagerPlugin) FormatTagName ¶
func (p *TagManagerPlugin) FormatTagName(version semver.SemVersion) string
FormatTagName formats a version as a tag name using the configured prefix.
func (*TagManagerPlugin) GetConfig ¶
func (p *TagManagerPlugin) GetConfig() *Config
GetConfig returns the plugin configuration.
func (*TagManagerPlugin) GetLatestTag ¶
func (p *TagManagerPlugin) GetLatestTag() (semver.SemVersion, error)
GetLatestTag returns the latest semver tag from git.
func (*TagManagerPlugin) IsEnabled ¶
func (p *TagManagerPlugin) IsEnabled() bool
IsEnabled returns whether auto-create is enabled.
func (*TagManagerPlugin) Name ¶
func (p *TagManagerPlugin) Name() string
func (*TagManagerPlugin) TagExists ¶
func (p *TagManagerPlugin) TagExists(version semver.SemVersion) (bool, error)
TagExists checks if a tag for the given version already exists.
func (*TagManagerPlugin) ValidateTagAvailable ¶
func (p *TagManagerPlugin) ValidateTagAvailable(version semver.SemVersion) error
ValidateTagAvailable ensures a tag can be created for the version.
func (*TagManagerPlugin) Version ¶
func (p *TagManagerPlugin) Version() string