modulith

package
v0.1.0-preview.4 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package modulith defines canonical descriptors for compile-time application module boundaries.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Module

func Module() sdk.Definition

Module marks package documentation as an application-module root.

The root package is the module's default public API. Descendant packages are internal unless explicitly exposed by NamedInterface. Spice validates cross-module import edges, allowed dependencies, cycles, and unassigned packages before generation.

// @import { Module } from "github.com/spice-framework/spice/annotation/modulith"
// @Module(allowedDependencies=["example.com/app/inventory"])
package orders

func ModuleHandler

func ModuleHandler(
	_ context.Context,
	invocation sdk.Invocation,
) (sdk.Result, error)

ModuleHandler contributes an application-module root and its allowed dependencies.

func NamedInterface

func NamedInterface() sdk.Definition

NamedInterface exposes one descendant package as a named module API.

The descriptor is repeatable on package documentation. Consumers reference the owning module and API explicitly; a named interface never exposes other descendant packages by implication.

// @import { NamedInterface } from "github.com/spice-framework/spice/annotation/modulith"
// @NamedInterface("events")
package api

func NamedInterfaceHandler

func NamedInterfaceHandler(
	_ context.Context,
	invocation sdk.Invocation,
) (sdk.Result, error)

NamedInterfaceHandler contributes one explicitly exposed module API.

Types

This section is empty.

Jump to

Keyboard shortcuts

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