Documentation ¶
Index ¶
Constants ¶
View Source
const ( // General EmptyLineRegex string = `^\s*$` URLRegex string = `` /* 242-byte string literal not displayed */ SemVerRegex string = `` /* 177-byte string literal not displayed */ DateRegex string = `([1-2][0-9][0-9][0-9])-([1-9]|[0][1-9]|[1][0-2])-([1-9]|[0][1-9]|[1-2][0-9]?|[3][0-1]?)` // Margins TitleRegex string = `^#\s*(?P<title>\S*)\s*$` UnreleasedTitleRegex string = `^## \[(?P<title>Unreleased)\]$` UnreleasedTitleWithLinkRegex string = `^## \[(?P<title>Unreleased)\]\((?P<url>` + URLRegex + `)\)$` VersionTitleRegex string = `^## \[(?P<version>` + SemVerRegex + `)\] - (?P<date>` + DateRegex + `)$` VersionTitleWithLinkRegex string = `^## \[(?P<version>` + SemVerRegex + `)\]\((?P<url>` + URLRegex + `)\) - (?P<date>` + DateRegex + `)$` MarkdownUnreleasedTitleLinkRegex string = `^\[(?P<title>Unreleased)\]: (?P<url>` + URLRegex + `)$` MarkdownVersionTitleLinkRegex string = `^\[(?P<version>` + SemVerRegex + `)\]: (?P<url>` + URLRegex + `)$` // Scopes AddedScopeRegex string = `^### (?P<scope>Added)$` ChangedScopeRegex string = `^### (?P<scope>Changed)$` DeprecatedScopeRegex string = `^### (?P<scope>Deprecated)$` RemovedScopeRegex string = `^### (?P<scope>Removed)$` FixedScopeRegex string = `^### (?P<scope>Fixed)$` SecurityScopeRegex string = `^### (?P<scope>Security)$` EntryRegex string = `^(?P<marker>[-*+]\s*)(?P<entry>.*)$` )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Changes ¶
type Changes struct { Notice *string Added *[]string Changed *[]string Deprecated *[]string Removed *[]string Fixed *[]string Security *[]string }
Changes are scoped changelog entries for a single version.
type Filesystem ¶ added in v0.0.2
type Parser ¶
type Parser struct { Filepath string Filesystem Filesystem Buffer []string Margins struct { Lines []int Title *int Unreleased *int Releases []int Links []int Added []int Changed []int Deprecated []int Removed []int Fixed []int Security []int } }
Parser is basically a runtime that holds a raw changelog content, key file Margins, filesystem backend and other attributes.
func NewParserWithFilesystem ¶
func NewParserWithFilesystem(filesystem Filesystem, filepath string) (*Parser, error)
NewParser creates a new Changelog Parser using non default (OS) filesystem. Possible options for `filesystems` are: [`afero.NewOsFs()`,`afero.NewMemMapFs()`]
Click to show internal directories.
Click to hide internal directories.