template

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2024 License: Apache-2.0 Imports: 4 Imported by: 1 module, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseRender

type BaseRender struct {
	Version     string            // cwgo version
	PackageName string            // package name in target generation go file
	Imports     map[string]string // key:import path value:import name
}

func (*BaseRender) GetImports

func (bt *BaseRender) GetImports() string

func (*BaseRender) RenderObj

func (bt *BaseRender) RenderObj(buffer *bytes.Buffer) error

type FuncRender

type FuncRender struct {
	Name     string
	Comment  string
	Params   code.Params
	Returns  code.Returns
	FuncBody code.Body
}

func (*FuncRender) RenderObj

func (fr *FuncRender) RenderObj(buffer *bytes.Buffer) error

type InterfaceRender

type InterfaceRender struct {
	Name    string
	Comment string
	Methods code.InterfaceMethods
}

func (*InterfaceRender) RenderObj

func (ir *InterfaceRender) RenderObj(buffer *bytes.Buffer) error

type MethodRender

type MethodRender struct {
	Name           string
	Comment        string
	MethodReceiver code.MethodReceiver
	Params         code.Params
	Returns        code.Returns
	MethodBody     code.Body
}

func (*MethodRender) RenderObj

func (mr *MethodRender) RenderObj(buffer *bytes.Buffer) error

type Render

type Render interface {
	RenderObj(buffer *bytes.Buffer) error
}

type StructRender

type StructRender struct {
	Name         string
	Comment      string
	StructFields code.StructFields
}

func (*StructRender) RenderObj

func (sr *StructRender) RenderObj(buffer *bytes.Buffer) error

type Template

type Template struct {
	Renders []Render
}

func (*Template) AddRender

func (t *Template) AddRender(render Render)

func (*Template) Build

func (t *Template) Build() (*bytes.Buffer, error)

Jump to

Keyboard shortcuts

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