changelog

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AssetSpec

type AssetSpec struct {
	CreatedAt   time.Time `json:",omitempty"`
	ContentType string    `json:",omitempty"`
	DownloadURL string    `json:",omitempty"`
	Name        string    `json:",omitempty"`
	UpdatedAt   string    `json:",omitempty"`
	Size        int       `json:",omitempty"`
}

ReleaseAssetspec contains information about release assets

type Changelog

type Changelog struct {
	Config Config
}

type Config

type Config struct {
	// Name specifies the name of the changelog to retrieve. It is only used for identification purposes.
	Name string
	// dir specifies the directory where changelog files will be repost.
	Dir string
	// kind specifies the kind of changelog to retrieve.
	//
	// accepted values:
	//   * github
	//
	Kind string
	// format specifies the format of the changelog to generate.
	Formats []ConfigFormat
	// spec specifies the configuration input for a specific kind of changelog.
	Spec interface{}
}

Config contains various information used to configure the way changelogs are retrieved

func (*Config) Sanitize

func (c *Config) Sanitize(configFile string) error

Sanitize ensures that the configuration is valid and that all required fields are set.

func (Config) SaveIndexToDisk

func (c Config) SaveIndexToDisk(changelogs []Spec) error

SaveIndexToDisk saves an index file per format to disk

func (Config) SaveToDisk

func (c Config) SaveToDisk(changelogs []Spec) error

SaveToDisk saves one changelog per file per format to disk

type ConfigFormat

type ConfigFormat struct {
	//
	// Extension is the file extension used for the changelog file.
	//
	// accepted values:
	//    * markdown
	//    * json
	//    * asciidoc
	//
	//  default: markdown
	//
	Extension string
	// FileTemplate is the template used to generate the changelog file
	//
	// default: depends on the extension
	//
	// remark: This setting is useless for json files
	//
	FileTemplate string
	// indexFileName is the name of the index file name without the extension.
	//
	// default: '_index'
	//
	IndexFileName string
	// IndexFileTemplate is the template used to generate the index file
	//
	// default: depends on the extension
	//
	// remark: This setting is useless for json files
	//
	IndexFileTemplate string
	// indexFrontMatters is the front matters using yaml syntax to add to the index file.
	//
	// default: empty
	//
	IndexFrontMatters string
	// frontmatters is the front matters using yaml syntax to add to the changelog file.
	//
	// default: empty
	//
	FrontMatters string
}

func (*ConfigFormat) Sanitize

func (c *ConfigFormat) Sanitize() error

type IndexData

type IndexData struct {
	Latest       Spec
	Changelogs   []Spec
	FrontMatters string
}

type ReleaseData

type ReleaseData struct {
	Changelog    Spec
	FrontMatters string
}

type Spec

type Spec struct {
	Assets          []AssetSpec `json:",omitempty"`
	Author          string      `json:",omitempty"`
	Title           string      `json:",omitempty"`
	Description     string      `json:",omitempty"`
	DescriptionHTML string      `json:",omitempty"`
	URL             string      `json:",omitempty"`
	PublishedAt     string      `json:",omitempty"`
	UpdatedAt       string      `json:",omitempty"`
	Tag             string      `json:",omitempty"`
	Name            string      `json:",omitempty"`
	/*
		Path is the path to the file containing the changelog.
	*/
	Path string `json:",omitempty"`
}

Spec contains various information used to describe target changes

Jump to

Keyboard shortcuts

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