genutils

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

README

genutils

Utilities for writing Go code generators

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GeneratedFilename

func GeneratedFilename(prefix, name string) string

func Title

func Title(s string) string

func WriteFile

func WriteFile(o WriteFileOption) error

Types

type Builder

type Builder func() Cmd

func New

func New(name string) Builder

func (Builder) Apply

func (b Builder) Apply() Cmd

func (Builder) WithDescription

func (b Builder) WithDescription(description string) Builder

func (Builder) WithGenerator

func (b Builder) WithGenerator(key string, generator genall.Generator) Builder

func (Builder) WithGenerators

func (b Builder) WithGenerators(generators map[string]genall.Generator) Builder

func (Builder) WithHelper

func (b Builder) WithHelper(helper string) Builder

func (Builder) WithOutputRule

func (b Builder) WithOutputRule(key string, outputRule genall.OutputRule) Builder

func (Builder) WithOutputRules

func (b Builder) WithOutputRules(outputRules map[string]genall.OutputRule) Builder

type Cmd

type Cmd struct {
	// contains filtered or unexported fields
}

func (Cmd) Run

func (c Cmd) Run()

type WriteFileOption

type WriteFileOption struct {
	// CmdName is the name of the command line used to
	CmdName    string
	Filename   string
	HeaderFile string

	Buffer *bytes.Buffer
	Ctx    *genall.GenerationContext
	Root   *loader.Package
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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