vtypes

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CompilerError

type CompilerError struct {
	Type     ErrorType
	Message  string
	Field    string
	Struct   string
	Rule     string
	Position string
}

CompilerError represents an error during compilation

func (CompilerError) Error

func (e CompilerError) Error() string

type CompilerErrors

type CompilerErrors []CompilerError

CompilerErrors holds multiple compiler errors

func (*CompilerErrors) Add

func (errs *CompilerErrors) Add(err CompilerError)

func (CompilerErrors) Error

func (errs CompilerErrors) Error() string

func (CompilerErrors) HasErrors

func (errs CompilerErrors) HasErrors() bool

type ErrorType

type ErrorType int
const (
	ErrorTypeIncompatible ErrorType = iota
	ErrorTypeMissing
	ErrorTypeInvalid
	ErrorTypeDuplicate
)

type FieldType

type FieldType struct {
	GoType     types.Type // The actual Go type
	Kind       TypeKind   // Simplified type classification
	IsPointer  bool       // Whether it's a pointer type
	IsSlice    bool       // Whether it's a slice type
	Underlying types.Type // Underlying type for pointers/slices
}

FieldType represents the type information for a struct field

type GenerationConfig

type GenerationConfig struct {
	InputFile               string
	PackagePath             string
	OutputFile              string
	PackageName             string
	ValforgePackage         string // Name of the package for supporting code (default: "valforge")
	ValforgePackagePath     string // Path to error package (e.g., "internal/valgen")
	ModuleName              string
	ProjectRoot             string // Project root directory
	Version                 string
	IncTimestampsInComments bool
}

GenerationConfig holds configuration for code generation

type TypeKind

type TypeKind int
const (
	TypeUnknown TypeKind = iota
	TypeString
	TypeInt
	TypeInt8
	TypeInt16
	TypeInt32
	TypeInt64
	TypeUint
	TypeUint8
	TypeUint16
	TypeUint32
	TypeUint64
	TypeFloat32
	TypeFloat64
	TypeBool
	TypeStruct
)

func (TypeKind) String

func (tk TypeKind) String() string

type ValidationField

type ValidationField struct {
	Name     string
	Type     FieldType
	JSONName string
	Rules    map[string]string
}

ValidationField represents a field with validation rules and type info

type ValidationStruct

type ValidationStruct struct {
	Name        string
	PackageName string
	Fields      []ValidationField
}

ValidationStruct represents a struct with validation

Jump to

Keyboard shortcuts

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