Documentation
¶
Index ¶
- Variables
- type Renderer
- func (renderer *Renderer) EventCreate(w io.Writer, events *collect.EventMap) error
- func (renderer *Renderer) EventCreateFile() string
- func (renderer *Renderer) EventData(w io.Writer, events *collect.EventMap) error
- func (renderer *Renderer) EventDataFile() string
- func (renderer *Renderer) Index(w io.Writer, index *collect.PackageIndex) error
- func (renderer *Renderer) IndexFile() string
- func (renderer *Renderer) Models(w io.Writer, imports *collect.ImportMap, models []*collect.ModelInfo) error
- func (renderer *Renderer) ModelsFile() string
- func (renderer *Renderer) Service(w io.Writer, info *collect.ServiceInfo) error
- func (renderer *Renderer) ServiceFile(name string) string
Constants ¶
This section is empty.
Variables ¶
var Newline string
Functions ¶
This section is empty.
Types ¶
type Renderer ¶
type Renderer struct {
// contains filtered or unexported fields
}
Renderer holds the template set for a given configuration. It provides methods for rendering various output modules.
func NewRenderer ¶
func NewRenderer(collector *collect.Collector, options *flags.GenerateBindingsOptions) *Renderer
NewRenderer initialises a code renderer for the given configuration and data collector.
func (*Renderer) EventCreate ¶
EventCreate renders the given event map to w as event data creation code.
func (*Renderer) EventCreateFile ¶
EventCreateFile returns the standard name of the event data creation file with the appropriate extension.
func (*Renderer) EventDataFile ¶
EventDataFile returns the standard name of the event data definitions file with the appropriate extension.
func (*Renderer) IndexFile ¶
IndexFile returns the standard name of a package index file with the appropriate extension.
func (*Renderer) Models ¶
func (renderer *Renderer) Models(w io.Writer, imports *collect.ImportMap, models []*collect.ModelInfo) error
Models renders type definitions for the given list of models.
func (*Renderer) ModelsFile ¶
ModelsFile returns the standard name of a models file with the appropriate extension.
func (*Renderer) ServiceFile ¶
ServiceFile returns the standard name of a service file for the given struct name, with the appropriate extension.