Documentation
¶
Index ¶
- func ClusterProfileToShortName(annotation string) (string, error)
- func Diff(a, b []byte, fileName string) string
- func EscapeForLiteral(in string) string
- func GetPathPrefix(wd, path, packagePath string) (string, error)
- func HasClusterProfilePreference(annotations map[string]string) bool
- func NewGengoJSONFile() gengogenerator.FileType
- func PrintResults(resultsByGroup map[string][]generation.Result) error
- type AggregatePrinter
- type Markdown
- func (m *Markdown) Bytes() []byte
- func (m *Markdown) EndTableRow()
- func (m *Markdown) Exact(text string)
- func (m *Markdown) ExactBytes() []byte
- func (m *Markdown) ExactText(text string)
- func (m *Markdown) ExactTextf(format string, args ...any)
- func (m *Markdown) NewOrderedListItem()
- func (m *Markdown) NextTableColumn()
- func (m *Markdown) OrderedListEnd()
- func (m *Markdown) OrderedListStart()
- func (m *Markdown) Text(text string)
- func (m *Markdown) Textf(format string, args ...any)
- func (m *Markdown) Title(level int, text string)
- func (m *Markdown) UnlistedTitle(level int, text string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Diff ¶
Diff returns a string containing the diff between the two strings. This is equivalent to running `git diff` on the two strings.
func EscapeForLiteral ¶
EscapeForLiteral escapes common characters so they render properly
func GetPathPrefix ¶
GetPathPrefix calculates the pathPrefix that needs to be trimmed from the output file. The generator will generate the output file to the current working directory plus the package path name. This function calculates what is needed to be trimmed from the package path name to make sure the output ends up in the correct directory. Eg. if the package is github.com/openshift.io/api/machine/v1,
- the current working directory is /home/user/go/src, then the path would be github.com/openshift.io/api/machine/v1 and so the output would be the empty string.
- the current working directory is /home/user/go/src/github.com/openshift.io/api, then the path would be machine/v1 and so the output would be github.com/openshift.io/api.
func NewGengoJSONFile ¶
func NewGengoJSONFile() gengogenerator.FileType
func PrintResults ¶
func PrintResults(resultsByGroup map[string][]generation.Result) error
Types ¶
type AggregatePrinter ¶
type AggregatePrinter struct {
// contains filtered or unexported fields
}
AggregatePrinter is an error wrapper that prints out aggregate and wrapped errors as individual errors in individual lines.
func NewAggregatePrinter ¶
func NewAggregatePrinter(err error) AggregatePrinter
NewAggregatePrinter creates a new Aggregate error.
func (AggregatePrinter) Error ¶
func (a AggregatePrinter) Error() string
Error prints the error out as a string. It unwraps wrapped errors and iterates over aggregate errors to print errors on invidividual lines.
type Markdown ¶
type Markdown struct {
// contains filtered or unexported fields
}
func NewMarkdown ¶
func (*Markdown) EndTableRow ¶
func (m *Markdown) EndTableRow()
func (*Markdown) ExactBytes ¶
ExactBytes returns markdown with table of contents or title. Useful for embedding.
func (*Markdown) ExactTextf ¶
func (*Markdown) NewOrderedListItem ¶
func (m *Markdown) NewOrderedListItem()
func (*Markdown) NextTableColumn ¶
func (m *Markdown) NextTableColumn()
func (*Markdown) OrderedListEnd ¶
func (m *Markdown) OrderedListEnd()
func (*Markdown) OrderedListStart ¶
func (m *Markdown) OrderedListStart()