kernel

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	Graph *Graph

	Controllers map[string]any
	// contains filtered or unexported fields
}

func Bootstrap

func Bootstrap(root module.Module) (*App, error)

func (*App) CleanupHooks added in v0.4.0

func (a *App) CleanupHooks() []func(context.Context) error

CleanupHooks returns provider cleanup hooks in LIFO order.

func (*App) Get

func (a *App) Get(token module.Token) (any, error)

Get resolves a token from the root module scope.

func (*App) Resolver

func (a *App) Resolver() module.Resolver

Resolver returns a root-scoped resolver that enforces module visibility.

type Container

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

func (*Container) Get

func (c *Container) Get(token module.Token) (any, error)

Get resolves a provider without module visibility checks. Visibility enforcement is applied via module-scoped resolvers.

type ControllerBuildError

type ControllerBuildError struct {
	Module     string
	Controller string
	Err        error
}

func (*ControllerBuildError) Error

func (e *ControllerBuildError) Error() string

func (*ControllerBuildError) Unwrap

func (e *ControllerBuildError) Unwrap() error

type DuplicateControllerNameError

type DuplicateControllerNameError struct {
	Module string
	Name   string
}

func (*DuplicateControllerNameError) Error

type DuplicateModuleNameError

type DuplicateModuleNameError struct {
	Name string
}

func (*DuplicateModuleNameError) Error

func (e *DuplicateModuleNameError) Error() string

type DuplicateProviderTokenError

type DuplicateProviderTokenError struct {
	Token   module.Token
	Modules []string
}

func (*DuplicateProviderTokenError) Error

type ExportNotVisibleError

type ExportNotVisibleError struct {
	Module string
	Token  module.Token
}

func (*ExportNotVisibleError) Error

func (e *ExportNotVisibleError) Error() string

type Graph

type Graph struct {
	Root    string
	Modules []ModuleNode
	Nodes   map[string]*ModuleNode
}

func BuildGraph

func BuildGraph(root module.Module) (*Graph, error)

type InvalidModuleDefError

type InvalidModuleDefError struct {
	Module string
	Reason string
}

func (*InvalidModuleDefError) Error

func (e *InvalidModuleDefError) Error() string

func (*InvalidModuleDefError) Unwrap

func (e *InvalidModuleDefError) Unwrap() error

type InvalidModuleNameError

type InvalidModuleNameError struct {
	Name string
}

func (*InvalidModuleNameError) Error

func (e *InvalidModuleNameError) Error() string

type ModuleCycleError

type ModuleCycleError struct {
	Path []string
}

func (*ModuleCycleError) Error

func (e *ModuleCycleError) Error() string

type ModuleNode

type ModuleNode struct {
	Name    string
	Module  module.Module
	Def     module.ModuleDef
	Imports []string
}

type ModuleNotPointerError

type ModuleNotPointerError struct {
	Module string
}

func (*ModuleNotPointerError) Error

func (e *ModuleNotPointerError) Error() string

type NilImportError

type NilImportError struct {
	Module string
	Index  int
}

func (*NilImportError) Error

func (e *NilImportError) Error() string

type ProviderBuildError

type ProviderBuildError struct {
	Module string
	Token  module.Token
	Err    error
}

func (*ProviderBuildError) Error

func (e *ProviderBuildError) Error() string

func (*ProviderBuildError) Unwrap

func (e *ProviderBuildError) Unwrap() error

type ProviderCycleError

type ProviderCycleError struct {
	Token module.Token
}

func (*ProviderCycleError) Error

func (e *ProviderCycleError) Error() string

type ProviderNotFoundError

type ProviderNotFoundError struct {
	Module string
	Token  module.Token
}

func (*ProviderNotFoundError) Error

func (e *ProviderNotFoundError) Error() string

type RootModuleNilError

type RootModuleNilError struct{}

func (*RootModuleNilError) Error

func (e *RootModuleNilError) Error() string

type TokenNotVisibleError

type TokenNotVisibleError struct {
	Module string
	Token  module.Token
}

func (*TokenNotVisibleError) Error

func (e *TokenNotVisibleError) Error() string

type Visibility

type Visibility map[string]map[module.Token]bool

Jump to

Keyboard shortcuts

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