module

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2025 License: MIT Imports: 4 Imported by: 0

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

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 NewModule

func NewModule(name, path string) *ModuleImpl

NewModule 创建新模块

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) GetState

func (m *ModuleImpl) GetState() ModuleState

GetState 获取状态

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 获取值

func (*ModuleImpl) Import

func (m *ModuleImpl) Import(name string, alias string, from string) error

Import 导入

func (*ModuleImpl) Name

func (m *ModuleImpl) Name() string

Name 获取模块名

func (*ModuleImpl) Path

func (m *ModuleImpl) Path() string

Path 获取模块路径

func (*ModuleImpl) SetState

func (m *ModuleImpl) SetState(state ModuleState)

SetState 设置状态

type ModuleState

type ModuleState int

ModuleState 模块状态

const (
	ModuleUnloaded ModuleState = iota
	ModuleLoading
	ModuleLoaded
	ModuleInitializing
	ModuleInitialized
	ModuleError
)

Jump to

Keyboard shortcuts

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