changelog

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2020 License: MIT Imports: 22 Imported by: 0

Documentation

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)

Entryname Scheme: $ROOT/.changelogs/unrelease/$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 Regex
	IsPreRelease bool     `mapstructure:"prerelease"` // True if the release is a pre-release
	ReleaseDate  string   `mapstructure:"date"`       // Release Date in ISO foramt (eg. "2019-12-24")
}

ReleaseInfo holds all informations about the current release

type TplEntries

type TplEntries struct {
	ShortTypeName string         // Short Type Name, eg. "Added"
	NumString     string         // Contains the 'Number of Changes' String, eg: "1 change" OR "5 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