Struct Intelligence for Go. Zero Dependencies.

Extract struct metadata once, cache it permanently, and discover relationships between types.

Getting Started
import "github.com/zoobz-io/sentinel"

type User struct {
    ID      string   `json:"id" db:"id" validate:"required"`
    Email   string   `json:"email" validate:"required,email" foo:"bar"`
    Profile *Profile
    Orders  []Order
}

metadata := sentinel.Scan[User]()
// metadata.TypeName → "User"
// metadata.FQDN     → "github.com/app/models.User"
// metadata.Fields   → []FieldMetadata (4 fields)

field := metadata.Fields[0]
// field.Name → "ID"
// field.Kind → "scalar"
// field.Tags → {"json": "id", "db": "id", "validate": "required"}


rel := metadata.Relationships[0]
// rel.From  → "github.com/app/models.User"
// rel.To    → "github.com/app/models.Profile"
// rel.Kind  → "reference"

sentinel.Browse()
// ["models.User", "models.Profile", "models.Order"]
99%Test Coverage
A+Go Report
MITLicense
1.24+Go Version
v1.0.4Latest Release

Why Sentinel?

Built for production Go codebases where type metadata matters.

Zero Dependencies

Nothing but the Go standard library. No bloat, no surprises.

Permanent Caching

Types don't change at runtime, so why extract them more than once?

Type-Safe Generics

Catch your mistakes at compile time, not in production.

Relationship Discovery

References, collections, embeddings, and maps — all mapped automatically.

Module-Aware Scanning

Point it at a type and it walks the entire graph within your module.

Thread-Safe

Safe for concurrent reads after the first extraction. No mutexes required.

Capabilities

Everything sentinel extracts from your Go types, cached permanently after first access.

FeatureDescriptionLink
Metadata ExtractionFields, types, indices, categories, and every struct tag you care about.Concepts
Relationship DiscoverySee how your types connect — references, collections, embeddings, and maps.Scanning
Permanent CachingExtract once, use forever. No cache invalidation to worry about.Architecture
Custom TagsRegister your own struct tags and sentinel will parse them for you.Tags
Module-Aware ScanningRecursively extract related types without leaving your module boundary.Scanning
Schema ExportDump everything sentinel knows in one call with Schema().API

Articles

Browse the full sentinel documentation.

Learn

OverviewStruct metadata extraction and relationship discovery for Go
QuickstartGet started with sentinel in 5 minutes
ConceptsMental models for understanding sentinel
ArchitectureInternal design and component interactions in sentinel

Guides

ScanningInspect vs Scan and module boundary detection
Custom TagsRegistering and extracting custom struct tags
Testing with SentinelTesting patterns and cache behavior
TroubleshootingCommon issues and how to resolve them

Integrations

Entity Relationship DiagramsEntity relationship diagrams from Go types
Type-Safe QueriesSQL query building from Go types
OpenAPI GenerationOpenAPI generation from Go types

Reference

API ReferenceComplete function documentation for sentinel
Type ReferenceComplete type documentation for sentinel