generator

package
v3.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMap

func NewMap(proj *config.Project, options ...Option) (map[string]*Generator, error)

NewMap instanstiates a map of all Generators defined in a Project.

Types

type Generator

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

Generator generates files for new resources from data models and templates.

func New

func New(conf *config.Generator, options ...Option) (*Generator, error)

New returns a new Generator from config.

func (*Generator) Run

func (g *Generator) Run(scope *VersionScope) error

Run executes the Generator. If generated artifacts already exist, a warning is logged but the file is not overwritten, unless force is true.

type Option

type Option func(g *Generator)

Option configures a Generator.

func Debug

func Debug(debug bool) Option

Debug turns on template debug logging.

func Force

func Force(force bool) Option

Force configures the Generator to overwrite generated artifacts.

type VersionScope

type VersionScope struct {
	API       string
	Resource  string
	Version   string
	Stability string
}

VersionScope identifies a distinct resource version that the generator is building for.

Jump to

Keyboard shortcuts

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