Help us shape the future of Go! Take the 2026 Go Developer Survey

sealed

package
v0.0.13 Latest Latest
Warning

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

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

Documentation

Overview

Package sealed provides a compile-time token that gates construction of [usecase.Result] success values. The Token type has an unexported field, so it cannot be constructed outside this package, and Go's internal/ import rule prevents anything outside pkg/fcsdk/ from importing this package at all.

The combined effect: only packages under pkg/fcsdk/ can mint a Token, and only with a Token can a caller invoke usecase.Success. This is compile-time enforced. Living under pkg/fcsdk/internal/ (rather than the repo-root internal/) is what scopes the seal to the SDK: platform code (internal/platform/...) cannot import it and so cannot mint a Success outside a UnitOfWork Commit*.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Token

type Token struct {
	// contains filtered or unexported fields
}

Token is the unforgeable witness that a caller is internal to the SDK. It is intentionally an empty struct with no exported fields and no way to construct one outside this package.

func New

func New() Token

New produces a Token. Callable only by packages that can import pkg/fcsdk/internal/sealed — i.e. anything under pkg/fcsdk/. Application code is shut out at the import level.

Jump to

Keyboard shortcuts

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