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.
Click to show internal directories.
Click to hide internal directories.