golang

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Binding

type Binding struct {
	From string // Source: header/path/query
	Name string // Field name in the source
}

Binding represents a field binding from headers, path, or query

type Const

type Const struct {
	Type    string
	Name    string
	Value   string
	Comment string
}

Const represents a Go constant

type Context

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

Context holds all necessary information used during code generation.

type Enum

type Enum struct {
	Name    string
	Fields  []EnumField
	Comment string
}

Enum represents a Go enum

type EnumField

type EnumField struct {
	Name    string
	Value   int64
	Comment string
}

EnumField represents a single field in a Go enum

type Generator

type Generator struct{}

func (*Generator) Gen

func (g *Generator) Gen(config *generator.Config, files map[string]tidl.Document, meta *tidl.MetaInfo) error

Gen is the main entry point for generating code.

type RPC

type RPC struct {
	Name     string // Method name
	Request  string // Request type name
	Response string // Response type name
	Stream   bool   // Whether this RPC is a streaming RPC
	Path     string // HTTP path
	Method   string // HTTP method (GET, POST, etc.)
	Comment  string // comment or description of the RPC
}

RPC represents a single remote procedure call with HTTP metadata.

type Type

type Type struct {
	Name    string
	Fields  []TypeField
	Comment string
}

Type represents a Go struct

func (*Type) BindingCount

func (t *Type) BindingCount() int

BindingCount returns the number of fields in the struct that have binding info

type TypeField

type TypeField struct {
	Type     string
	TypeKind TypeKind
	Name     string
	Default  *string
	Tag      string
	Validate *string
	Binding  *Binding
	Comment  string
}

TypeField represents a field in a Go struct

type TypeKind

type TypeKind int

TypeKind represents kind of a Go field type

const (
	TypeKindUnknown TypeKind = iota
	TypeKindBaseType
	TypeKindOptionalBaseType
	TypeKindEnumType
	TypeKindOptionalEnumType
	TypeKindStructType
	TypeKindOptionalStructType
	TypeKindListType
	TypeKindMapType
)

type ValidateFunc

type ValidateFunc struct {
	Name      string
	FieldType string
}

ValidateFunc represents a custom validation function

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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