codegen

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

templ: version: v0.3.924

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConstructIdent

func ConstructIdent(c Case, parts ...string) string

ConstructIdent combines parts with the given Case and returns a new formatted ident.

Examples:

ConstructIdent(SnakeCase, "get", "user", "response") // "get_user_response"
ConstructIdent(CamelCase, "get", "user", "response") // "getUserResponse"
ConstructIdent(PascalCase, "get", "user", "response") // "GetUserResponse"

func Page

func Page(options options.Options, gen Generation, httpMode bool) templ.Component

Types

type Case

type Case int
const (
	SnakeCase Case = iota
	CamelCase
	PascalCase
)

type Generation

type Generation struct {
	Language string
	Code     string
}

Generation represents the generated code for a specific programming language

func Generate

func Generate(language string, openapi openapi.OpenAPI) (*Generation, error)

type Golang

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

func NewGolang

func NewGolang(w io.Writer) *Golang

func (*Golang) Error

func (g *Golang) Error() error

func (*Golang) Generate

func (g *Golang) Generate(document openapi.OpenAPI)

type InvalidLanguageError

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

func (*InvalidLanguageError) Error

func (err *InvalidLanguageError) Error() string

type TypeScript

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

func NewTypeScript

func NewTypeScript(w io.Writer, indent string) *TypeScript

func (*TypeScript) Error

func (ts *TypeScript) Error() error

func (*TypeScript) Generate

func (ts *TypeScript) Generate(document openapi.OpenAPI)

Jump to

Keyboard shortcuts

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