changelog

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrVersionNotFound is returned when a version is not found
	ErrVersionNotFound = errors.New("version not found")

	// ErrVersionExists is returned when a version already exists
	ErrVersionExists = errors.New("version already exists")
)

Functions

This section is empty.

Types

type Changelog

type Changelog struct {
	Versions []*VersionEntry `json:"versions"`
}

Changelog represents the entire CHANGELOG.md file

type ChangelogContent

type ChangelogContent struct {
	Added      []string `json:"added,omitempty"`
	Changed    []string `json:"changed,omitempty"`
	Deprecated []string `json:"deprecated,omitempty"`
	Removed    []string `json:"removed,omitempty"`
	Fixed      []string `json:"fixed,omitempty"`
	Security   []string `json:"security,omitempty"`
}

ChangelogContent represents the content of a changelog entry

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service provides changelog operations

func NewService

func NewService(cfg *config.Config) *Service

NewService creates a new changelog service

func (*Service) AddEntry

func (s *Service) AddEntry(version string, date string, content *ChangelogContent) error

AddEntry adds a new changelog entry

func (*Service) GetAll

func (s *Service) GetAll() (*Changelog, error)

GetAll retrieves the entire changelog

func (*Service) GetByVersion

func (s *Service) GetByVersion(version string) (*VersionEntry, error)

GetByVersion retrieves a specific version entry

func (*Service) UpdateEntry

func (s *Service) UpdateEntry(version string, date string, content *ChangelogContent) error

UpdateEntry updates an existing changelog entry

type VersionEntry

type VersionEntry struct {
	Version string            `json:"version"`
	Date    string            `json:"date"`
	Content *ChangelogContent `json:"content"`
}

VersionEntry represents a version entry in the changelog

Jump to

Keyboard shortcuts

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