Help us shape the future of Go! Take the 2026 Go Developer Survey

stucture

package
v0.2.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseStructure

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

func (*BaseStructure) GetParent

func (s *BaseStructure) GetParent() StructureElement

func (*BaseStructure) GetRoot

func (s *BaseStructure) GetRoot() *FileStructure

type ClassStructure

type ClassStructure struct {
	BaseStructure

	Package string
	Name    string

	Methods    map[string]*FunctionStructure
	Properties map[string]*FieldStructure
}

func NewClassStructure

func NewClassStructure(root *FileStructure, parent StructureElement, pkg, name string) *ClassStructure

func (*ClassStructure) AddClass

func (s *ClassStructure) AddClass(pkg string, name string) *ClassStructure

func (*ClassStructure) AddFunction

func (s *ClassStructure) AddFunction(name string, params []string, result string) *FunctionStructure

func (*ClassStructure) FullName

func (s *ClassStructure) FullName() string

type FieldStructure

type FieldStructure struct {
	BaseStructure

	Name string
	Type string
}

type FileStructure

type FileStructure struct {
	Path string

	Classes   map[string]*ClassStructure
	Functions map[string]*FunctionStructure

	AllClasses    map[string]*ClassStructure
	AllFunctions  map[string]*FunctionStructure
	AllStructures map[any]StructureElement
}

func NewFileStructure

func NewFileStructure(path string) *FileStructure

func (*FileStructure) AddClass

func (s *FileStructure) AddClass(pkg string, name string) *ClassStructure

func (*FileStructure) AddFunction

func (s *FileStructure) AddFunction(name string, params []string, result string) *FunctionStructure

func (*FileStructure) AddInternalClass

func (s *FileStructure) AddInternalClass(c *ClassStructure)

func (*FileStructure) AddInternalFunctions

func (s *FileStructure) AddInternalFunctions(f *FunctionStructure)

func (*FileStructure) FullName

func (s *FileStructure) FullName() string

func (*FileStructure) GetParent

func (s *FileStructure) GetParent() StructureElement

func (*FileStructure) GetRoot

func (s *FileStructure) GetRoot() *FileStructure

func (*FileStructure) ResolveClasses

func (s *FileStructure) ResolveClasses()

type FunctionStructure

type FunctionStructure struct {
	BaseStructure

	Name   string
	Params []string
	Result string
}

func NewFunctionStructure

func NewFunctionStructure(root *FileStructure, parent StructureElement, name string, params []string, result string) *FunctionStructure

func (*FunctionStructure) AddClass

func (s *FunctionStructure) AddClass(pkg string, name string) *ClassStructure

func (*FunctionStructure) AddFunction

func (s *FunctionStructure) AddFunction(name string, params []string, result string) *FunctionStructure

func (*FunctionStructure) FullName

func (s *FunctionStructure) FullName() string

type StructureElement

type StructureElement interface {
	FullName() string
	GetRoot() *FileStructure
	GetParent() StructureElement
	AddClass(pkg string, name string) *ClassStructure
	AddFunction(name string, params []string, result string) *FunctionStructure
}

Jump to

Keyboard shortcuts

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