domain

package
v0.3.21 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package domain contains the domain layer for the application.

The domain layer models the business dependent but application independent code. It contains the representation of the real world objects and processes that the application intends to model. This layer is also the centre of the application, meaning that it should not include any dependencies on the other three layers of the application.

The domain layer is usually quite thin, and sometimes only contains some struct and repository definitions. However, representations of business processes also live in this layer.

When deciding if code should go in the domain layer, a good starting question is "does this code model something that would exist in the business even if our application did not exist?". If the answer is yes, then it most likely lives here.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound      = errors.New("not found")
	ErrAlreadyExists = errors.New("already exists")
	ErrInternal      = errors.New("internal error")
	ErrUnavailable   = errors.New("unavailable")
)

Errors to be returned by usecases and repository implementations.

Repositories should wrap these errors with sufficient context to enable debugging. Usecases are then responsible for recording the error using logging and/or tracing. Once recorded, usecases should return an unwrapped error with unambiguous meaning for the calling adapter to convert to an appropriate user-facing error response.

Additional errors should be defined here if the meaning of a particular error cannot be mapped to a specific error response.

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis
Package entities contains the models for the application.
Package entities contains the models for the application.
Package repositories package describes the implementation-agnostic interaction points with other parts of the business.
Package repositories package describes the implementation-agnostic interaction points with other parts of the business.

Jump to

Keyboard shortcuts

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