module

package
v0.3.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: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidModuleDef = errors.New("invalid module definition")

ErrInvalidModuleDef indicates a module definition is invalid.

Functions

This section is empty.

Types

type ControllerDef

type ControllerDef struct {
	Name  string
	Build func(r Resolver) (any, error)
}

ControllerDef describes how to build a controller instance.

type Module

type Module interface {
	Definition() ModuleDef
}

Module provides its definition for graph construction.

type ModuleDef

type ModuleDef struct {
	Name        string
	Imports     []Module
	Providers   []ProviderDef
	Controllers []ControllerDef
	Exports     []Token
}

ModuleDef declares metadata for a module.

type ProviderDef

type ProviderDef struct {
	Token Token
	Build func(r Resolver) (any, error)
}

ProviderDef describes how to build a provider for a token.

type Resolver

type Resolver interface {
	Get(Token) (any, error)
}

Resolver provides access to resolved provider instances.

type Token

type Token string

Token identifies a provider for resolution.

Jump to

Keyboard shortcuts

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