Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var FuncMap = template.FuncMap{ "ToLower": strings.ToLower, "GoName": generatego.CamelCase, "ToLowCamelName": ToLowCamelName, "ToSnake": snaker.CamelToSnake, "PackageName": genutil.GetPackageName, }
FuncMap contains a series of utility functions to be passed into templates and used within those templates.
Functions ¶
func ApplyTemplate ¶
func ApplyTemplate(templ string, templName string, data interface{}, funcMap template.FuncMap) (io.Reader, error)
ApplyTemplate is a helper methods that packages can call to render a template with any data and func map
func ToLowCamelName ¶
lowCamelName returns a CamelCased string, but with the first letter lowercased. "example_name" becomes "exampleName".
Types ¶
type Data ¶
type Data struct { // import path for the directory containing the definition .proto files ImportPath string // import path for .pb.go files containing service structs PBImportPath string ExternalMessageImports []string // PackageName is the name of the package containing the service definition PackageName string // GRPC/Protobuff service, with all parameters and return values accessible Service *svcdef.Service ClientArgs *clientarggen.ClientServiceArgs // A helper struct for generating http transport functionality. HTTPHelper *httptransport.Helper FuncMap template.FuncMap Version string VersionDate string }
Data is passed to templates as the executing struct; its fields and methods are used to modify the template
Directories ¶
Path | Synopsis |
---|---|
Package clientarggen collects information for templating the code in a truss-generated client which marshals command line flags into message fields for each service.
|
Package clientarggen collects information for templating the code in a truss-generated client which marshals command line flags into message fields for each service. |
Package generator generates a gokit service based on a service definition.
|
Package generator generates a gokit service based on a service definition. |
Package handlers manages the exported methods in the service handler code adding/removing exported methods to match the service definition.
|
Package handlers manages the exported methods in the service handler code adding/removing exported methods to match the service definition. |
Package httptransport provides functions and template helpers for templating the http-transport of a go-kit based service.
|
Package httptransport provides functions and template helpers for templating the http-transport of a go-kit based service. |
This file is here to hold the `go generate` command above.
|
This file is here to hold the `go generate` command above. |
Click to show internal directories.
Click to hide internal directories.