codegen

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrorType = Type{Name: "error", Kind: TypeBuiltin}

Functions

func Contains

func Contains[T comparable](l util.LinkedList[T], el T) bool

func Find

func Find[E any](coll []E, f func(E) bool) *E

Types

type Document

type Document struct {
	Structs NamedList[*StructDescriptor]
}

func (Document) AllChildrenOf

func (d Document) AllChildrenOf(parent StructDescriptor) []StructDescriptor

func (Document) AllParentsOf

func (d Document) AllParentsOf(each StructDescriptor) []StructDescriptor

func (Document) ChildrenOf

func (d Document) ChildrenOf(parent StructDescriptor) []StructDescriptor

type FieldDescriptor

type FieldDescriptor struct {
	Name        string
	Description string
	Type        *TypeDescriptor
	OneOf       []string
	Enum        []string
}

type Generator

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

func NewGenerator

func NewGenerator(doc *Document) *Generator

func (Generator) Generate

func (g Generator) Generate() (*ast.File, error)

type NamedList

type NamedList[T any] []T

type StructDescriptor

type StructDescriptor struct {
	Name        string
	Description string
	Extends     string
	Abstract    bool
	Fields      NamedList[*FieldDescriptor]
}

type Type

type Type struct {
	Name    string
	Package string
	Kind    TypeKind
	Elem    *Type
}

func (Type) Ast

func (t Type) Ast() ast.Expr

func (Type) Ptr

func (t Type) Ptr() Type

func (Type) QualifiedName

func (t Type) QualifiedName() ast.Expr

func (Type) Slice

func (t Type) Slice() Type

func (Type) String

func (t Type) String() string

type TypeDescriptor

type TypeDescriptor struct {
	Kind  TypeDescriptorKind
	Name  string
	Elems []*TypeDescriptor
}

func (*TypeDescriptor) IsList

func (t *TypeDescriptor) IsList() bool

func (*TypeDescriptor) IsUnion

func (t *TypeDescriptor) IsUnion() bool

type TypeDescriptorKind

type TypeDescriptorKind uint8
const (
	TypeDescriptorKindUnknown TypeDescriptorKind = iota
	TypeDescriptorKindBasic
	TypeDescriptorKindList
	TypeDescriptorKindUnion
)

type TypeKind

type TypeKind uint8
const (
	TypeUnknown TypeKind = iota
	TypeBuiltin
	TypeInterface
	TypeStruct
	TypePointer
	TypeSlice
	TypeMap
)

Directories

Path Synopsis
Command distill generates YouTrack API models and Client methods directly from YouTrack's OpenAPI document.
Command distill generates YouTrack API models and Client methods directly from YouTrack's OpenAPI document.

Jump to

Keyboard shortcuts

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