render

package
v3.0.0-alpha.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 18, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

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) Index

func (renderer *Renderer) Index(w io.Writer, index *collect.PackageIndex) error

Index renders the given package index to w.

func (*Renderer) IndexFile

func (renderer *Renderer) IndexFile() string

IndexFile returns the standard name of a package index file with the appropriate extension.

func (*Renderer) InternalFile

func (renderer *Renderer) InternalFile() string

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

func (renderer *Renderer) ModelsFile() string

ModelsFile returns the standard name of a models file with the appropriate extension.

func (*Renderer) Service

func (renderer *Renderer) Service(w io.Writer, info *collect.ServiceInfo) error

Service renders binding code for the given service type to w.

func (*Renderer) ServiceFile

func (renderer *Renderer) ServiceFile(name string) string

ServiceFile returns the standard name of a service file for the given struct name, with the appropriate extension.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL