parser

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RgxFirstLine = regexp.MustCompile(`#\s[A-Za-z]+\s[A-Za-z]+\s(?P<version>v?\d+.\d+.\d+(?:-\d+)?)\s\((?P<date>\d{4}-\d{2}-\d{2})\)`)
	RgxLastLine  = regexp.MustCompile(`\*Released\sby\s(?P<name>.*?)\s<(?P<mail>.*?)>`)
)

Functions

This section is empty.

Types

type Author

type Author struct {
	Name  string
	Email string
}

type Changes

type Changes map[string]string

func (Changes) Format

func (c Changes) Format(indent int) string

func (Changes) FormatByAuthor

func (c Changes) FormatByAuthor(author string, indent int) string

func (Changes) SortedAuthors added in v0.3.0

func (c Changes) SortedAuthors() []string

type Release

type Release struct {
	Header   string
	Footer   string
	Version  *semver.Version
	Date     time.Time
	Changes  Changes
	By       Author
	Released bool
}

func NewRelease

func NewRelease() *Release

func (*Release) GenerateFooter

func (r *Release) GenerateFooter()

func (*Release) GenerateHeader

func (r *Release) GenerateHeader(bump string)

func (*Release) MarshalJSON added in v0.2.0

func (r *Release) MarshalJSON() ([]byte, error)

func (*Release) ParseBody

func (r *Release) ParseBody(body string)

func (*Release) ParseFooter

func (r *Release) ParseFooter()

func (*Release) ParseHeader

func (r *Release) ParseHeader()

func (*Release) Show

func (r *Release) Show() string

type Releases

type Releases []*Release

func PrependRelease

func PrependRelease(releases Releases, release *Release) Releases

func ReadFile

func ReadFile(filename string) (Releases, error)

Jump to

Keyboard shortcuts

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