generator

package
v0.0.0-...-371464c Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2024 License: Apache-2.0 Imports: 6 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
	Options() Options
}

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 Buildkit

func Buildkit(s bool) Option

Buildkit determines whether or not Buildkit integration is enabled.

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 GRPC

func GRPC(s bool) Option

GRPC determines whether or not GRPC integration is enabled.

func Health

func Health(s bool) Option

Health determines whether or not health proto service is enabled.

func Kustomize

func Kustomize(s bool) Option

Kustomize determines whether or not Kustomize integration is enabled.

func Namespace

func Namespace(s string) Option

Namespace

func PostgresAddress

func PostgresAddress(s string) Option

PostgresAddress

func PrivateRepo

func PrivateRepo(s bool) Option

PrivateRepo

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 Sqlc

func Sqlc(s bool) Option

Sqlc determines whether or not Sqlc integration is enabled.

func Tern

func Tern(s bool) Option

Tern determines whether or not Tern integration is enabled.

func Tilt

func Tilt(s bool) Option

Tilt sets whether or not Tilt integration is enabled.

func Trace

func Trace(t bool) Option

Trace sets whether or not Trace 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
	// Trace determines whether or not Trace integration is enabled.
	Trace bool
	// Skaffold determines whether or not Skaffold integration is enabled.
	Skaffold bool
	// Tilt determines whether or not Tilt integration is enabled.
	Tilt bool
	// Health determines whether or not health proto service is enabled.
	Health bool
	// Kustomize determines whether or not Kustomize integration is enabled.
	Kustomize bool
	// Sqlc determines whether or not Sqlc integration is enabled.
	Sqlc bool
	// GRPC determines whether or not GRPC integration is enabled.
	GRPC bool
	// Buildkit determines whether or not Buildkit integration is enabled.
	Buildkit bool
	// Tern directory whether or not Tern integration is enabled.
	Tern bool
	// PrivateRepo
	PrivateRepo bool
	// Namespace sets the default namespace
	Namespace string
	// PostgresAddress sets the default postgres address
	PostgresAddress string
}

Options represents the options for the generator.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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