parser

package
v0.0.0-...-ee9a62b Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2023 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Field

type Field struct {
	Name        string
	Type        string
	Index       int
	TypeKind    string
	IsStruct    bool
	IsPtr       bool
	IsSlice     bool
	IsSame      bool
	PackagePath string
	Obj         reflect.Type `json:"-"`
}

func (*Field) Parse

func (fi *Field) Parse(field reflect.StructField, pkg string) bool

type Method

type Method struct {
	Name        string
	PackagePath string
	InParams    []*Param
	OutParams   []*Param
	NamedString string
	Index       int
}

func (*Method) GenerateEmptyReturn

func (mt *Method) GenerateEmptyReturn() string

func (*Method) HasReturnError

func (mt *Method) HasReturnError() bool

func (*Method) LenOut

func (mt *Method) LenOut() int

func (*Method) LenOutIfEq

func (mt *Method) LenOutIfEq(ln int) bool

func (*Method) LenOutIfGt

func (mt *Method) LenOutIfGt(ln int) bool

func (*Method) Parse

func (mt *Method) Parse(method reflect.Method)

func (*Method) ParseParams

func (mt *Method) ParseParams(method reflect.Method)

type Param

type Param struct {
	Index       int
	PackagePath string
	Type        string
	TypeKind    uint
	IsStruct    bool
	IsPtr       bool
	IsSlice     bool
	Obj         reflect.Type `json:"-"`
}

type Struct

type Struct struct {
	Name         string        `json:"name"`
	BasePacket   string        `json:"basepacket"`
	Imports      []string      `json:"imports"`
	Item         *StructItem   `json:"item"`
	RelatedItems []*StructItem `json:"related"`
	Object       any           `json:"-"`
}

func NewStructParser

func NewStructParser(item any) Struct

func (*Struct) ConvertItem

func (s *Struct) ConvertItem(obj reflect.Type) reflect.Type

func (*Struct) Parse

func (s *Struct) Parse()

func (*Struct) ParseFields

func (s *Struct) ParseFields(relatedStrck *StructItem)

func (*Struct) ParseMethods

func (s *Struct) ParseMethods(relatedStrck *StructItem)

func (*Struct) ParseStructItem

func (s *Struct) ParseStructItem(obj reflect.Type)

type StructItem

type StructItem struct {
	Name        string
	Fields      []Field
	Methods     []*Method
	PackagePath string
	Imports     []string
	TypeName    string
	BasePacket  string
	Object      reflect.Type `json:"-"`
}

func (*StructItem) AddImport

func (si *StructItem) AddImport(imp string)

func (*StructItem) GetBaseItem

func (si *StructItem) GetBaseItem(item reflect.Type) reflect.Type

func (*StructItem) Parse

func (si *StructItem) Parse(parser func(reflect.Type))

Jump to

Keyboard shortcuts

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