Documentation
¶
Overview ¶
Copyright 2025 The Hulo Authors. All rights reserved. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.
Copyright 2025 The Hulo Authors. All rights reserved. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.
Index ¶
- type DependencyResolver
- func (dr *DependencyResolver) AddModule(module *ModuleImpl)
- func (dr *DependencyResolver) BreakCycle(cycle []string) error
- func (dr *DependencyResolver) DetectCycles() ([]string, error)
- func (dr *DependencyResolver) ResolveDependencies() error
- func (dr *DependencyResolver) TopologicalSort() ([]string, error)
- type ExportInfo
- type ExportKind
- type ImportInfo
- type ImportKind
- type ModuleImpl
- func (m *ModuleImpl) AddDependency(dep *ModuleImpl)
- func (m *ModuleImpl) Export(name string, value interface{}) error
- func (m *ModuleImpl) GetDependencies() map[string]*ModuleImpl
- func (m *ModuleImpl) GetState() ModuleState
- func (m *ModuleImpl) GetType(name string) (core.Type, bool)
- func (m *ModuleImpl) GetValue(name string) (core.Value, bool)
- func (m *ModuleImpl) Import(name string, alias string, from string) error
- func (m *ModuleImpl) Name() string
- func (m *ModuleImpl) Path() string
- func (m *ModuleImpl) SetState(state ModuleState)
- type ModuleState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DependencyResolver ¶
type DependencyResolver struct {
// contains filtered or unexported fields
}
DependencyResolver 依赖解析器
func NewDependencyResolver ¶
func NewDependencyResolver() *DependencyResolver
NewDependencyResolver 创建依赖解析器
func (*DependencyResolver) AddModule ¶
func (dr *DependencyResolver) AddModule(module *ModuleImpl)
AddModule 添加模块
func (*DependencyResolver) BreakCycle ¶
func (dr *DependencyResolver) BreakCycle(cycle []string) error
BreakCycle 打破循环依赖
func (*DependencyResolver) DetectCycles ¶
func (dr *DependencyResolver) DetectCycles() ([]string, error)
DetectCycles 检测循环依赖
func (*DependencyResolver) ResolveDependencies ¶
func (dr *DependencyResolver) ResolveDependencies() error
ResolveDependencies 解析所有依赖
func (*DependencyResolver) TopologicalSort ¶
func (dr *DependencyResolver) TopologicalSort() ([]string, error)
TopologicalSort 拓扑排序
type ExportInfo ¶
type ExportInfo struct {
// contains filtered or unexported fields
}
ExportInfo 导出信息
type ExportKind ¶
type ExportKind int
ExportKind 导出类型
const ( ExportType ExportKind = iota ExportFunction ExportValue ExportOperator )
type ImportInfo ¶
type ImportInfo struct {
// contains filtered or unexported fields
}
ImportInfo 导入信息
type ImportKind ¶
type ImportKind int
ImportKind 导入类型
const ( ImportDefault ImportKind = iota ImportNamed ImportNamespace ImportAll )
type ModuleImpl ¶
type ModuleImpl struct {
// contains filtered or unexported fields
}
func (*ModuleImpl) AddDependency ¶
func (m *ModuleImpl) AddDependency(dep *ModuleImpl)
AddDependency 添加依赖
func (*ModuleImpl) Export ¶
func (m *ModuleImpl) Export(name string, value interface{}) error
Export 导出
func (*ModuleImpl) GetDependencies ¶
func (m *ModuleImpl) GetDependencies() map[string]*ModuleImpl
GetDependencies 获取依赖
func (*ModuleImpl) GetType ¶
func (m *ModuleImpl) GetType(name string) (core.Type, bool)
GetType 获取类型
func (*ModuleImpl) GetValue ¶
func (m *ModuleImpl) GetValue(name string) (core.Value, bool)
GetValue 获取值
type ModuleState ¶
type ModuleState int
ModuleState 模块状态
const ( ModuleUnloaded ModuleState = iota ModuleLoading ModuleLoaded ModuleInitializing ModuleInitialized ModuleError )
Click to show internal directories.
Click to hide internal directories.