create

package
v1.1.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const DefaultPackage = "uber.prototool.generated"

DefaultPackage is the default package to use in lieu of one being able to be derived.

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 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