contract

package
v3.13.0 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 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 CliModule

type CliModule interface {
	Module
	RegisterCliCommands(kernelInstance kernelcontract.Kernel) []clicontract.Command
}

type ConfigModule added in v3.1.0

type ConfigModule interface {
	Module
	RegisterConfigurations(registrar ConfigRegistrar)
}

type ConfigRegistrar added in v3.1.0

type ConfigRegistrar interface {
	RegisterConfiguration(name string, configuration any)
}

type EventModule

type EventModule interface {
	Module
	RegisterEventSubscribers(kernelInstance kernelcontract.Kernel)
}

type HttpHandlerDecorator added in v3.9.0

type HttpHandlerDecorator func(next nethttp.Handler) nethttp.Handler

HttpHandlerDecorator wraps the fully built nethttp.Handler the http kernel produces, forming the outermost seam of the request lifecycle: unlike a middleware — which wraps only the routed handler and never sees requests short-circuited by kernel.request listeners (for example security denials) — a decorator observes every request, including 401/403 short-circuits, the panic-recovery path and responses written by event listeners. The first registered decorator is the outermost.

type HttpHandlerDecoratorModule added in v3.9.0

type HttpHandlerDecoratorModule interface {
	Module
	RegisterHttpHandlerDecorators(kernelInstance kernelcontract.Kernel) []HttpHandlerDecorator
}

type HttpMiddlewareModule

type HttpMiddlewareModule interface {
	Module
	RegisterHttpMiddlewares(kernelInstance kernelcontract.Kernel, registrar HttpMiddlewareRegistrar)
}

type HttpMiddlewareRegistrar

type HttpMiddlewareRegistrar interface {
	Use(middlewares ...httpcontract.Middleware)

	UseWithPriority(priority int, middlewares ...httpcontract.Middleware)
}

type HttpModule

type HttpModule interface {
	Module
	RegisterHttpRoutes(kernelInstance kernelcontract.Kernel)
}

type Module

type Module interface {
	Name() string

	Description() string
}

type ModuleProvider

type ModuleProvider interface {
	Modules() []Module
}

type ParameterModule

type ParameterModule interface {
	Module
	RegisterParameters(registrar ParameterRegistrar)
}

type ParameterRegistrar

type ParameterRegistrar interface {
	RegisterParameter(name string, value any)

	/* RegisterSecretParameter declares a parameter holding a credential, so the commands that render the configuration redact it and every parameter whose template reads it. */
	RegisterSecretParameter(name string, value any)

	/* MarkParameterSecret marks a parameter that already exists, which is how the credentials melody registers automatically from the .env artifacts are covered. */
	MarkParameterSecret(name string)
}

type ServiceModule

type ServiceModule interface {
	Module
	RegisterServices(registrar ServiceRegistrar)
}

type ServiceRegistrar

type ServiceRegistrar interface {
	containercontract.Registrar

	RegisterService(
		serviceName string,
		provider any,
		options ...containercontract.RegisterOption,
	)
}

ServiceRegistrar is also a container registrar, so a module can register through the container's typed helpers — container.MustRegisterType and the wiring generated on top of it — as well as by name.

Jump to

Keyboard shortcuts

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