generator

package
v4.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
	// Path specifies where the file will reside.
	Path string
	// Template is the template used to generate the file.
	Template string
}

File represents a file to generate.

type Generator

type Generator interface {
	Generate([]File) error
}

Generator is the interface that generates project template files.

Generate accepts a list of files and generates them based on their template.

func New

func New(opts ...Option) Generator

New returns a new generator struct.

type Option

type Option func(o *Options)

Option manipulates the Options passed.

func Client

func Client(c bool) Option

Client sets whether or not the project is a client project.

func Directory

func Directory(d string) Option

Directory sets the directory in which files are generated.

func Jaeger

func Jaeger(j bool) Option

Jaeger sets whether or not Jaeger integration is enabled.

func Service

func Service(s string) Option

Service sets the service name.

func Skaffold

func Skaffold(s bool) Option

Skaffold sets whether or not Skaffold integration is enabled.

func Vendor

func Vendor(v string) Option

Vendor sets the service vendor.

type Options

type Options struct {
	// Service is the name of the service the generator will generate files
	// for.
	Service string
	// Vendor is the service vendor.
	Vendor string
	// Directory is the directory where the files will be generated to.
	Directory string

	// Client determines whether or not the project is a client project.
	Client bool
	// Jaeger determines whether or not Jaeger integration is enabled.
	Jaeger bool
	// Jaeger determines whether or not Skaffold integration is enabled.
	Skaffold bool
}

Options represents the options for the generator.

Directories

Path Synopsis
cmd module
cmd Module

Jump to

Keyboard shortcuts

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