changelog

package module
v0.0.0-...-ccd49ca Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2023 License: GPL-3.0 Imports: 8 Imported by: 0

README

codecov Go Report Card GoDoc

Documentation

Overview

Package changelog provides a way to create, parse and convert changelogs. Currently, only parsing Markdown keep-a-changelog style and Debian changelogs is implemented for input, and only Debian changelog for output.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotSemver = fmt.Errorf("not semver") // string is not a valid semver
)

Error codes

Functions

This section is empty.

Types

type Change

type Change struct {
	Type string // "Added", "Fixed", etc.
	Body string // the actual description
}

Change is one change (usually one line in a changelog)

type Changelog

type Changelog map[Version]Release

Changelog is the complete changelog representation

func ParseDebian

func ParseDebian(r io.Reader) (cl Changelog, err error)

ParseDebian reads a Debian changelog into Changelog

func ParseMd

func ParseMd(r io.Reader) (cl Changelog, err error)

ParseMd reads a markdown file (keep-a-changelog style format) into Changelog

func (Changelog) Debian

func (cl Changelog) Debian(packageName string) (out []byte, err error)

Debian outputs Changelog with debian changelog formatting

type Maintainer

type Maintainer struct {
	Name  string
	Email string
}

Maintainer is the maintainer of the package

type Release

type Release struct {
	Date         time.Time
	Changes      []Change
	Urgency      string     // urgency in Debian terms, "medium" is used if none is provided
	Distribution string     // distribution released to (Debian-specific), "stable" is used if none is provided
	Maintainer   Maintainer // package maintainer
}

Release is a single release. A changelog usually comprises of several releases.

type Version

type Version struct {
	Major      int
	Minor      int
	Patch      int
	Prerelease string
}

Version is a recognized version (following semver conventions)

func ToVersion

func ToVersion(s string) (v Version, err error)

ToVersion converts string to Version (if possible)

func (Version) String

func (v Version) String() string

String implements fmt.Stringer interface for Version

Directories

Path Synopsis
cmd
changelog
The changelog binary generates a Debian changelog from a Markdown keep-a-changelog-style one
The changelog binary generates a Debian changelog from a Markdown keep-a-changelog-style one

Jump to

Keyboard shortcuts

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