util

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Changelog

type Changelog struct {
	Version      string
	Additions    []ChangelogEntry
	Changes      []ChangelogEntry
	Removals     []ChangelogEntry
	Deprecations []ChangelogEntry
	Bugfixes     []ChangelogEntry

	Repo string
}

func ChangelogFromEntries

func ChangelogFromEntries(version semver.Version, entries []FragmentEntry) Changelog

func (*Changelog) Template

func (c *Changelog) Template() ([]byte, error)

func (*Changelog) WriteFile

func (c *Changelog) WriteFile(path string) error

type ChangelogEntry

type ChangelogEntry struct {
	Description string
	Link        string
}

type EntryKind

type EntryKind string
const (
	Addition    EntryKind = "addition"
	Change      EntryKind = "change"
	Removal     EntryKind = "removal"
	Deprecation EntryKind = "deprecation"
	Bugfix      EntryKind = "bugfix"
)

func (EntryKind) Validate

func (k EntryKind) Validate() error

type EntryMigration

type EntryMigration struct {
	Header string `yaml:"header"`
	Body   string `yaml:"body"`
}

func (EntryMigration) Validate

func (m EntryMigration) Validate() error

type Fragment

type Fragment struct {
	Entries []FragmentEntry `yaml:"entries"`
}

func (*Fragment) Validate

func (f *Fragment) Validate() error

type FragmentEntry

type FragmentEntry struct {
	Description string          `json:"description"`
	Kind        EntryKind       `json:"kind"`
	Breaking    bool            `json:"breaking"`
	Migration   *EntryMigration `json:"migration,omitempty"`
	PullRequest *uint           `json:"pull_request_override,omitempty"`

	PullRequestLink string `json:"-"`
}

func LoadEntries

func LoadEntries(fragmentsDir, repo string) ([]FragmentEntry, error)

func (*FragmentEntry) Validate

func (e *FragmentEntry) Validate() error

type Migration

type Migration struct {
	Header          string
	Body            string
	PullRequestLink string
}

type MigrationGuide

type MigrationGuide struct {
	Version    string
	Weight     uint64
	Migrations []Migration
}

func MigrationGuideFromEntries

func MigrationGuideFromEntries(version semver.Version, entries []FragmentEntry) MigrationGuide

func (*MigrationGuide) Template

func (mg *MigrationGuide) Template() ([]byte, error)

func (*MigrationGuide) WriteFile

func (mg *MigrationGuide) WriteFile(path string) error

type PullRequestNumberGetter

type PullRequestNumberGetter interface {
	GetPullRequestNumberFor(file string) (uint, error)
}

Jump to

Keyboard shortcuts

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