Documentation ¶
Overview ¶
changelog implements the parser and writer for changelog entries and the CHANGELOG.md generator.
Index ¶
- func AddEntry(entry entry.Entry)
- func CheckDir()
- func GenerateChangelog(r *Release)
- func GetEntries(r *Release) error
- func GetReleasedEntries(r *Release) error
- func MoveEntries(version string) error
- func ParseFiles(files map[string][]byte) ([]entry.Entry, error)
- func PrintChangesFromLatest()
- func ReadEntryFiles(filesPath string) (map[string][]byte, error)
- type Release
- type ReleaseInfo
- type TplEntries
- type TplRelease
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddEntry ¶
AddEntry creates a new Changelog Entry by creating the Entry File under (default)
Entry name Scheme: $ROOT/.changelogs/unreleased/$BRANCH_NAME-$RAND_STRING
func CheckDir ¶
func CheckDir()
CheckDir will check if the changelog directory exists if not it will create and initialize it.
func GenerateChangelog ¶
func GenerateChangelog(r *Release)
GenerateChangelog will generate a new CHANGELOG.md
func GetEntries ¶
GetEntries returns a List of all Entries found in the Changelog-Data directory.
func GetReleasedEntries ¶
GetReleasedEntries returns a slice which contains all released entries
func MoveEntries ¶
MoveEntries will move all unreleased Entries to 'released/{{ .Version }}'
func ParseFiles ¶
ParseFiles parses all given files into an Entries struct @param files is a map of 'FILE_PATH' => 'FILE_CONTENT'
func PrintChangesFromLatest ¶ added in v1.4.0
func PrintChangesFromLatest()
Types ¶
type Release ¶
type Release struct { Info *ReleaseInfo // All Informations about the current Release Entries []entry.Entry // Holds all NEW changelog entry Types // == Fields used in the Changelog Template == Releases []TplRelease // Holds all Releases }
Release contains the ReleaseInfo and all Changelog entry types.
type ReleaseInfo ¶
type ReleaseInfo struct { Version []string `yaml:"-"` // Contains the string slice output of the Regexp IsPreRelease bool `mapstructure:"prerelease"` // True if the release is a pre-release ReleaseDate string `mapstructure:"date"` // Release Date in ISO format (eg. "2019-12-24") }
ReleaseInfo holds all informations about the current release
type TplEntries ¶
type TplEntries struct { ShortTypeName string // ShortTypeName is the Short Type Name, eg. "Added" NumString string // NumString Contains the 'Number of Changes' String, eg: "1 change" OR "5 changes" NumChanges int // NumChanges Contains the 'Number of Changes' Changes []*entry.Entry // Contains the raw Change-Entry struct }
TplEntries is like a normal Entry, but it contains only Changes of a specific Change Type.
type TplRelease ¶
type TplRelease struct { Info *ReleaseInfo // All Informations about the this Release Version string // Release Version Collapse bool // This Field indicates if this Release should be collapsed Entries []TplEntries // Contains a list with all available Change-Entries }
TplRelease contains all Data of a Release
func (*TplRelease) SortEntries ¶ added in v1.2.0
func (t *TplRelease) SortEntries()
SortEntries does sort the `Entries` by their `ShortTypeName` field.