generator

package module
v0.0.0-...-03c50c3 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package generator provides nanorpc generators

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Generator

type Generator struct {
	// contains filtered or unexported fields
}

Generator is a proto generator for NanoRPC

func NewGenerator

func NewGenerator(p *protogen.Plugin) (*Generator, error)

NewGenerator assembles a nanorpc protoc generator

func (*Generator) T

func (gen *Generator) T(name string, out io.Writer, data any) error

T find a template, combines it with given data, and renders it onto the given Writer

func (*Generator) WithTemplates

func (gen *Generator) WithTemplates(root *template.Template, templates fs.FS) error

WithTemplates loads embedded templates/**.gotmpl into an existing template.Template

Jump to

Keyboard shortcuts

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