generator

package
v0.0.0-...-b7d109a Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package generator generates the breaking-changes and changelog messages for the checker package. The output, messages.yaml can be used by the checker package instead of the hardcoded messages under localizations_src. Advatages over manuallly writing the messages: - The generated ids and messages are consistent according to the logic in the generator. - The generator can be easily extended to support more messages. Additional work needed before using the generator: - Check that all messages are covered by the generator. - Decide what to do with Russian messages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(getter Getter) ([]string, error)

func GetTree

func GetTree(file string) func() (MessageGenerator, error)

Types

type Actions

type Actions map[string]Objects

type ChangeMap

type ChangeMap map[string]Changes

type ChangeTree

type ChangeTree struct {
	Changes    ChangeMap `yaml:"changes"`
	Components ChangeMap `yaml:"components"`
}

type Changes

type Changes struct {
	Ref                  string    `yaml:"$ref"`
	ExcludeFromHierarchy bool      `yaml:"excludeFromHierarchy"`
	Actions              Actions   `yaml:"actions"`
	NextLevel            ChangeMap `yaml:"nextLevel"`
}

type Getter

type Getter func() (MessageGenerator, error)

type IValueSet

type IValueSet interface {
	// contains filtered or unexported methods
}

type MessageGenerator

type MessageGenerator interface {
	// contains filtered or unexported methods
}

type Object

type Object struct {
	Hierarchy            []string `yaml:"hierarchy"`
	Names                []string `yaml:"names"`
	Adverbs              []string `yaml:"adverbs"`
	StartWithName        bool     `yaml:"startWithName"`
	PredicativeAdjective string   `yaml:"predicativeAdjective"`
	AttributiveAdjective string   `yaml:"attributiveAdjective"`
}

type Objects

type Objects []Object

type ValueSet

type ValueSet struct {
	AttributiveAdjective string // attributive adjectives are added before the object
	PredicativeAdjective string // predicative adjectives are added after the object
	Hierarchy            []string
	Names                []string
	Actions              []string
	Adverbs              []string
}

type ValueSetA

type ValueSetA ValueSet

ValueSetA messages start with the object for example: "api was removed without deprecation"

type ValueSetB

type ValueSetB ValueSet

ValueSetB messages start with the action for example: "removed %s request parameter %s"

type ValueSetList

type ValueSetList []ValueSet

type ValueSets

type ValueSets []IValueSet

Jump to

Keyboard shortcuts

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