changelog

package
v1.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 16, 2020 License: MIT Imports: 22 Imported by: 0

Documentation

Overview

changelog implements the parser and writer for changelog entries and the CHANGELOG.md generator.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddEntry

func AddEntry(entry entry.Entry)

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

func GetEntries(r *Release) error

GetEntries returns a List of all Entries found in the Changelog-Data directory.

func GetReleasedEntries

func GetReleasedEntries(r *Release) error

GetReleasedEntries returns a slice which contains all released entries

func MoveEntries

func MoveEntries(version string) error

MoveEntries will move all unreleased Entries to 'released/{{ .Version }}'

func ParseFiles

func ParseFiles(files map[string][]byte) ([]entry.Entry, error)

ParseFiles parses all given files into an Entries struct @param files is a map of 'FILE_PATH' => 'FILE_CONTENT'

func ReadEntryFiles

func ReadEntryFiles(filesPath string) (map[string][]byte, error)

ReadEntryFiles reads all changelog entry files form a given path

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL