nats-server

module
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2026 License: MIT

README

nats-server

A Go package for running an embedded NATS server.

release codecov license build powered by conventional commits nats built with just gitHub commit activity go reference

A NATS server as a goroutine in your own process.

Run a NATS server inside your own process with JetStream support and slog logging. No daemon to install and no broker to operate: the server is a goroutine in the program that starts it.

Install

go get github.com/osapi-io/nats-server

Features

See the server docs for quick start, authentication, and per-feature reference.

Feature Description Docs Source
Lifecycle management Non-blocking Start() / graceful Stop() with readiness docs server.go
slog integration Adapts slog.Logger to the NATS server logging interface docs logger.go
Configuration Options for host, port, store dir, auth, and timeouts docs types.go

Examples

Each example is a standalone Go program you can read and run.

Example What it shows
auth-none Start a server without authentication
auth-user-pass Server with username/password auth
auth-nkeys Server with NKey authentication
simple-server Minimal server startup and shutdown

Documentation

Contributing

See the Contributing guide for prerequisites, setup, conventions, and the PR workflow.

License

The MIT License.

Directories

Path Synopsis
pkg
server
Package server provides an embedded NATS server implementation.
Package server provides an embedded NATS server implementation.
server/mocks
Package mocks provides generated mock implementations for testing.
Package mocks provides generated mock implementations for testing.

Jump to

Keyboard shortcuts

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