Documentation
¶
Index ¶
- Variables
- func EnsureReleasesUniqueValidAndMonotonic(rs []Release) error
- type History
- func (h *History) Changelog() (string, error)
- func (h *History) CurrentNotes() string
- func (h *History) CurrentVersion() Version
- func (h *History) DeclareReleases(releaseLikes ...interface{}) (*History, error)
- func (h *History) MustChangelog() string
- func (h *History) MustDeclareReleases(releaseLikes ...interface{}) *History
- func (h *History) Project() string
- func (h *History) Release(versionLike interface{}) (Release, error)
- func (h *History) WithChangelogTemplate(tmpl *template.Template) *History
- type ImmutableHistory
- type Release
- type Version
Constants ¶
This section is empty.
Variables ¶
var DefaultChangelogTemplate = template.Must(template.New("default_changelog_template").
Parse(`# {{ .Project }} Changelog{{ range .Releases }}
## Version {{ .Version }}
{{ .Notes }}
{{ end }}`))
Functions ¶
func EnsureReleasesUniqueValidAndMonotonic ¶
Checks that a sequence of releases are monotonically decreasing with each version being a simple major, minor, or patch bump of its successor in the slice
Types ¶
type History ¶
The purpose of History is to capture version changes and change logs in a single location and use that data to generate releases and print changes to the command line to automate releases and provide a single source of truth for improved certainty around versions and releases
func NewHistory ¶
Define a new project history to which releases can be added in code e.g. var history = relic.NewHistory().MustDeclareReleases(...)
func (*History) CurrentNotes ¶
Gets the release notes for the current version
func (*History) CurrentVersion ¶
func (*History) DeclareReleases ¶ added in v1.0.0
Adds releases to the History with the newest releases provided first (so latest is at top). Releases can be specified by pairs of version (string or struct), notes (string) or by sequence of Release (struct) or mixtures thereof.
func (*History) MustChangelog ¶
Generates changelog, panicking if there is an error
func (*History) MustDeclareReleases ¶ added in v1.0.0
Like DeclareReleases but will panic if the Releases list becomes invalid
type ImmutableHistory ¶ added in v1.1.0
type ImmutableHistory interface {
// Get latest version
CurrentVersion() Version
// Get latest release note
CurrentNotes() string
// Get the project name
Project() string
// Get complete changelog
Changelog() (string, error)
// Get complete changelog or panic if error
MustChangelog() string
// Find the release specified by Version struct or version string
Release(versionLike interface{}) (Release, error)
}
Provides the read-only methods of History to ensure releases are not accidentally mutated when it is not intended
type Version ¶
type Version struct {
// contains filtered or unexported fields
}