example

package
v0.0.0-...-9358009 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package example is the public facade for the example domain. Register is the only symbol other packages may call — everything else lives under example/internal and is compiler-sealed.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(api huma.API, db *bun.DB, logger *slog.Logger) error

Register wires up the example domain's dependencies and registers its HTTP endpoints on api, backed by db. Unmapped errors are logged through logger.

Types

type Registered

type Registered struct{}

Registered is a marker wire depends on to sequence Register's side-effecting call into the generated injector.

func ProvideRegistration

func ProvideRegistration(api huma.API, db *bun.DB, logger *slog.Logger) (Registered, error)

ProvideRegistration calls Register and returns a marker wire can depend on to guarantee the registration ran.

Directories

Path Synopsis
Package domain holds the example domain's public entities, value objects, domain errors, and repository ports.
Package domain holds the example domain's public entities, value objects, domain errors, and repository ports.
internal
application
Package application holds the example domain's use cases.
Package application holds the example domain's use cases.
infrastructure/memory
Package memory provides an in-memory adapter for the example domain's repository ports.
Package memory provides an in-memory adapter for the example domain's repository ports.
infrastructure/postgres
Package postgres provides the example domain's Postgres-backed adapter for its repository ports.
Package postgres provides the example domain's Postgres-backed adapter for its repository ports.
presentation
Package presentation exposes the example domain's HTTP operations on a shared huma.API, translating domain errors into HTTP status codes.
Package presentation exposes the example domain's HTTP operations on a shared huma.API, translating domain errors into HTTP status codes.

Jump to

Keyboard shortcuts

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