change

package
v0.0.0-...-7d67436 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultUnreleasedDir = "changelogs/unreleased"
	FilenameExtension    = ".yml"
)
View Source
const UiApi = 1

Variables

View Source
var (
	ReasonNames = []string{
		"",
		"added",
		"fixed",
		"changed",
		"deprecated",
		"removed",
		"security",
		"performance",
		"other",
	}
	ReasonDescriptions = []string{
		"",
		"New Features",
		"Fixed Issues",
		"Changed Features",
		"Deprecated Features",
		"Removed Features",
		"Security Enhancements",
		"Performance Enhancements",
		"Other Changes",
	}
	ReasonInstances = []Reason{
		ReasonInvalid,
		ReasonAdded,
		ReasonFixed,
		ReasonChanged,
		ReasonDeprecated,
		ReasonRemoved,
		ReasonSecurity,
		ReasonPerformance,
		ReasonOther,
	}
)

Functions

func DefaultAuthor

func DefaultAuthor() string

func Slug

func Slug(title string) string

func TargetUiApi

func TargetUiApi() int

Types

type Entries

type Entries []*Entry

func (Entries) Authors

func (e Entries) Authors() []string

func (Entries) Filter

func (e Entries) Filter(filter func(*Entry) bool) Entries

func (Entries) FilterByComponent

func (e Entries) FilterByComponent(component string) Entries

func (Entries) FilterByReason

func (e Entries) FilterByReason(reason Reason) Entries

func (Entries) GroupByComponent

func (e Entries) GroupByComponent() map[string]Entries

func (Entries) GroupByReason

func (e Entries) GroupByReason() map[Reason]Entries

func (Entries) SortByAuthor

func (e Entries) SortByAuthor() Entries

func (Entries) SortByComponent

func (e Entries) SortByComponent() Entries

func (Entries) SortByMergeRequest

func (e Entries) SortByMergeRequest() Entries

func (Entries) SortByReason

func (e Entries) SortByReason() Entries

func (Entries) SortByTitle

func (e Entries) SortByTitle() Entries

type Entry

type Entry struct {
	Title        string `yaml:"title"`
	Author       string `yaml:"author"`
	Reason       Reason `yaml:"reason"`
	Component    string `yaml:"component,omitempty"`
	MergeRequest int    `yaml:"merge_request,omitempty"`
}

func NewEntry

func NewEntry() *Entry

func (*Entry) IsAnonymous

func (e *Entry) IsAnonymous() bool

func (*Entry) IsZero

func (e *Entry) IsZero() bool

func (*Entry) MergeRequestString

func (e *Entry) MergeRequestString() string

func (*Entry) Slug

func (e *Entry) Slug() string

func (*Entry) String

func (e *Entry) String() string

type EntryPrompt

type EntryPrompt struct {
	TargetUiApi int
}

func NewEntryPrompt

func NewEntryPrompt(targetUiApi int) *EntryPrompt

func (*EntryPrompt) Run

func (p *EntryPrompt) Run(entry *Entry) (bool, error)

type EntrySerializer

type EntrySerializer struct{}

func NewEntrySerializer

func NewEntrySerializer() *EntrySerializer

func (*EntrySerializer) Deserialize

func (s *EntrySerializer) Deserialize(data []byte) (interface{}, error)

func (*EntrySerializer) Serialize

func (s *EntrySerializer) Serialize(entry interface{}) ([]byte, error)

type Reason

type Reason int
const (
	ReasonInvalid Reason = iota
	ReasonAdded
	ReasonFixed
	ReasonChanged
	ReasonDeprecated
	ReasonRemoved
	ReasonSecurity
	ReasonPerformance
	ReasonOther
)

func ParseReason

func ParseReason(value string) (Reason, error)

func (Reason) Alias

func (r Reason) Alias() string

func (Reason) CapsString

func (r Reason) CapsString() string

func (Reason) Description

func (r Reason) Description() string

func (Reason) IsZero

func (r Reason) IsZero() bool

func (Reason) MarshalYAML

func (r Reason) MarshalYAML() (interface{}, error)

func (Reason) String

func (r Reason) String() string

func (Reason) TitleString

func (r Reason) TitleString() string

func (*Reason) UnmarshalJSON

func (r *Reason) UnmarshalJSON(value []byte) error

func (*Reason) UnmarshalText

func (r *Reason) UnmarshalText(value []byte) error

func (*Reason) UnmarshalYAML

func (r *Reason) UnmarshalYAML(value *yaml.Node) error

type Writer

type Writer struct {
	UnreleasedDir string
	Force         bool
	// contains filtered or unexported fields
}

func NewWriter

func NewWriter(output io.EntityWriter) *Writer

func (*Writer) Write

func (w *Writer) Write(e *Entry) (string, error)

func (*Writer) WriteFile

func (w *Writer) WriteFile(e *Entry, filename string) (string, error)

Jump to

Keyboard shortcuts

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