Documentation ¶
Overview ¶
Package template implements custom template output.
Index ¶
- type Compiler
- type FileTemplate
- func (t *FileTemplate) NoOverwrite() *FileTemplate
- func (t *FileTemplate) NoPreamble() *FileTemplate
- func (t *FileTemplate) Params(value any) *FileTemplate
- func (t *FileTemplate) PreamblePrefix(value string) *FileTemplate
- func (t *FileTemplate) WithLicense() *FileTemplate
- func (t *FileTemplate) WithLicenseText(value string) *FileTemplate
- type Output
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileTemplate ¶
type FileTemplate struct {
// contains filtered or unexported fields
}
FileTemplate defines a single file template to be generated by this output.
func (*FileTemplate) NoOverwrite ¶
func (t *FileTemplate) NoOverwrite() *FileTemplate
NoOverwrite generates the template only if it doesn't exist yet.
func (*FileTemplate) NoPreamble ¶
func (t *FileTemplate) NoPreamble() *FileTemplate
NoPreamble disables preamble geneneration.
func (*FileTemplate) Params ¶
func (t *FileTemplate) Params(value any) *FileTemplate
Params sets template params.
func (*FileTemplate) PreamblePrefix ¶
func (t *FileTemplate) PreamblePrefix(value string) *FileTemplate
PreamblePrefix sets preamble prefix.
func (*FileTemplate) WithLicense ¶
func (t *FileTemplate) WithLicense() *FileTemplate
WithLicense prepends the license text before the preamble.
func (*FileTemplate) WithLicenseText ¶
func (t *FileTemplate) WithLicenseText(value string) *FileTemplate
WithLicenseText sets the license text.
If unset and WithLicense is requested, the default MPL license is used.
type Output ¶
type Output struct { output.FileAdapter // contains filtered or unexported fields }
Output implements custom templates generation.
func (*Output) Compile ¶
Compile implements output.TypedWriter interface.
func (*Output) Define ¶
func (o *Output) Define(name, template string) *FileTemplate
Define should be called to add a templated file output.
Click to show internal directories.
Click to hide internal directories.