create

package
v1.11.1 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultPackage is the default package to use in lieu of one being able
	// to be derived.
	DefaultPackage = "uber.prototool.generated"
	// DefaultPackageV2 is the default package to use in lieu of one being able
	// to be derived if the lint group is "uber2".
	DefaultPackageV2 = "uber.prototool.generated.v1"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler interface {
	// Create the files at the given filePaths.
	Create(filePaths ...string) error
}

Handler handles creation of Protobuf files from a template.

func NewHandler

func NewHandler(options ...HandlerOption) Handler

NewHandler returns a new Handler.

type HandlerOption

type HandlerOption func(*handler)

HandlerOption is an option for a new Handler.

func HandlerWithConfigData

func HandlerWithConfigData(configData string) HandlerOption

HandlerWithConfigData returns a HandlerOption that uses the given configuration data instead of using configuration files that are found. This acts as if there is only one configuration file at the current working directory. All found configuration files are ignored.

func HandlerWithDevelMode

func HandlerWithDevelMode() HandlerOption

HandlerWithDevelMode returns a HandlerOption that allows devel-mode.

func HandlerWithLogger

func HandlerWithLogger(logger *zap.Logger) HandlerOption

HandlerWithLogger returns a HandlerOption that uses the given logger.

The default is to use zap.NewNop().

func HandlerWithPackage

func HandlerWithPackage(pkg string) HandlerOption

HandlerWithPackage returns a HandlerOption that uses the given package for new Protobuf files.

The default is to derive this from the file path, or use DefaultPackage.

Jump to

Keyboard shortcuts

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