Documentation
¶
Index ¶
- Constants
- func GenerateTypeDefinitions(glue *core.Glue) string
- func NewLuaScaffold(glue *core.Glue) Scaffold
- type Annotable
- type LuaAnnotations
- func (annotations *LuaAnnotations) Add(annotation Annotable)
- func (annotations *LuaAnnotations) AddClass(name string, fields []runtime.Field)
- func (annotations *LuaAnnotations) AddFunction(mod *core.GluePlugin)
- func (annotations *LuaAnnotations) FindAllByType(kind string) []Annotable
- func (annotations *LuaAnnotations) Render() string
- func (annotations *LuaAnnotations) Type() string
- type LuaClassAnnotation
- type LuaFuncAnnotation
- type LuaRC
- type LuaScaffold
- type LuaTableAnnotation
Constants ¶
const ( META = "meta" FUNC = "function" CLASS = "class" TABLE = "table" )
Variables ¶
This section is empty.
Functions ¶
func GenerateTypeDefinitions ¶
func NewLuaScaffold ¶
Types ¶
type LuaAnnotations ¶
type LuaAnnotations struct {
// contains filtered or unexported fields
}
func (*LuaAnnotations) Add ¶
func (annotations *LuaAnnotations) Add(annotation Annotable)
func (*LuaAnnotations) AddClass ¶
func (annotations *LuaAnnotations) AddClass(name string, fields []runtime.Field)
func (*LuaAnnotations) AddFunction ¶
func (annotations *LuaAnnotations) AddFunction(mod *core.GluePlugin)
func (*LuaAnnotations) FindAllByType ¶
func (annotations *LuaAnnotations) FindAllByType(kind string) []Annotable
func (*LuaAnnotations) Render ¶
func (annotations *LuaAnnotations) Render() string
func (*LuaAnnotations) Type ¶
func (annotations *LuaAnnotations) Type() string
type LuaClassAnnotation ¶
func (*LuaClassAnnotation) Render ¶
func (classAnnotation *LuaClassAnnotation) Render() string
func (*LuaClassAnnotation) Type ¶
func (classAnnotation *LuaClassAnnotation) Type() string
type LuaFuncAnnotation ¶
type LuaFuncAnnotation struct {
// contains filtered or unexported fields
}
func (*LuaFuncAnnotation) Render ¶
func (funcAnnotation *LuaFuncAnnotation) Render() string
func (*LuaFuncAnnotation) Type ¶
func (mod *LuaFuncAnnotation) Type() string
type LuaRC ¶
type LuaRC map[string]interface{}
func InitLuaRC ¶
InitLuaRC initializes a LuaRC configuration from a specified folder. It looks for a file named ".luarc.json" within the folder. If the file does not exist, it initializes an empty one
func LoadLuaRC ¶
LoadLuaRC tries to loads a LuaRC configuration from a specified file. It reads the file content and unmarshals the JSON data into a LuaRC map.
func (LuaRC) AddLibrary ¶
AddLibrary adds a library name to the LuaRC configuration. It ensures that the library name is added to the "workspace.library" key. If the "workspace.library" key does not exist, it creates it. If the library name already exists in the list, it does not add it again.
func (LuaRC) SaveToFolder ¶
SaveToFolder saves the LuaRC configuration to a specified folder. It writes the configuration to a file named ".luarc.json" within the folder. The file permissions are set to 0644 by default, but if the file already exists, it retains the existing file permissions
type LuaScaffold ¶
type LuaScaffold struct {
// contains filtered or unexported fields
}
func (*LuaScaffold) Setup ¶
func (s *LuaScaffold) Setup(folder string) error
func (*LuaScaffold) Typegen ¶
func (s *LuaScaffold) Typegen() string
type LuaTableAnnotation ¶
type LuaTableAnnotation struct {
Name string
Children []*LuaTableAnnotation
}
func (*LuaTableAnnotation) AddChild ¶
func (tableAnno *LuaTableAnnotation) AddChild(name string) *LuaTableAnnotation
func (*LuaTableAnnotation) Render ¶
func (tableAnno *LuaTableAnnotation) Render() string
func (*LuaTableAnnotation) Type ¶
func (tableAnno *LuaTableAnnotation) Type() string