Skip to content

Reference

Page Covers
Server settings ServerSettings — the embedded server
Client settings ClientSettings and CredentialSource — the connection
Errors The sentinels, and what each one means went wrong

The generated API reference lives at pkg.go.dev.

Packages

Import path Purpose
gitlab.com/phpboyscout/go/nats Settings, errors, CredentialSource
gitlab.com/phpboyscout/go/nats/server Embedded server, controls registration
gitlab.com/phpboyscout/go/nats/client Connection, bounded subscriptions

The split matters: importing nats/client alone does not pull a broker into your binary. Importing nats/server does, and should be a decision rather than a side effect.

On configuration

None of these structs is read from a file by this module. The calling application maps its own configuration onto them. Every field carries mapstructure, yaml and json tags so that mapping is a decode rather than a hand-written assignment.