changelog

package
v0.41.0 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2026 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package changelog parses the embedded CHANGELOG.md (see the top-level changelog package) into structured, filterable entries (ADR-0041).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Embedded added in v0.40.0

func Embedded() (string, error)

Embedded returns the complete authored changelog payload.

func EmbeddedRange added in v0.40.0

func EmbeddedRange(from, to string) ([]string, error)

EmbeddedRange returns release payloads in the inclusive selected range.

func EmbeddedSince added in v0.40.0

func EmbeddedSince(version string) ([]string, error)

EmbeddedSince returns release payloads newer than version.

func EmbeddedVersion added in v0.40.0

func EmbeddedVersion(version string) (string, error)

EmbeddedVersion returns one selected release payload.

Types

type Entry

type Entry struct {
	Version string // e.g. "0.5.1", no leading "v"
	Date    string // YYYY-MM-DD
	Raw     string // the section text, header line through end of body
}

Entry is one version's changelog section.

func Load

func Load(fsys fs.FS) ([]Entry, error)

Load reads "CHANGELOG.md" from fsys and parses it. touches-state: tooling/changelog-and-release:changelog-embed-decodes - embedded CHANGELOG.md decode; proof in changelog_test.go

func Parse

func Parse(raw []byte) ([]Entry, error)

Parse splits raw CHANGELOG.md content into ordered entries (newest first, matching file order). Content before the first header (the title and intro prose) is discarded - callers wanting the whole file read it directly instead. Parse errors if no version header is found.

func Range

func Range(entries []Entry, from, to string) ([]Entry, error)

Range returns every entry in [from, to] inclusive, newest first. from must be chronologically older than or equal to the to end (git range convention: from..to); a reversed pair errors rather than silently reordering. touches-state: tooling/changelog-and-release:changelog-range-chronological - chronological range selection; proof in changelog_test.go

func Since

func Since(entries []Entry, v string) ([]Entry, error)

Since returns every entry strictly newer than v (exclusive), newest first. It errors if v does not match any entry; it returns an empty (non-nil-error) slice if v is already the newest entry.

func Version

func Version(entries []Entry, v string) (Entry, error)

Version returns the single entry matching v.

Jump to

Keyboard shortcuts

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