Documentation ¶
Index ¶
- type Renderer
- func (renderer *Renderer) Index(w io.Writer, index *collect.PackageIndex) error
- func (renderer *Renderer) IndexFile() string
- func (renderer *Renderer) InternalFile() 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 ¶
This section is empty.
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(options *flags.GenerateBindingsOptions, collector *collect.Collector) *Renderer
NewRenderer initialises a code renderer for the given configuration and data collector.
func (*Renderer) IndexFile ¶
IndexFile returns the standard name of a package index file with the appropriate extension.
func (*Renderer) InternalFile ¶
InternalFile returns the standard name of an internal model file with the appropriate extension.
func (*Renderer) Models ¶
func (renderer *Renderer) Models(w io.Writer, imports *collect.ImportMap, models []*collect.ModelInfo) error
Models renders models code 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.