A Go package for running an embedded NATS server.
go get github.com/osapi-io/nats-serverSee 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 |
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 |
See the generated documentation for package-level API details.
See the Development guide for prerequisites, setup, and conventions. See the Contributing guide before submitting a PR.
The MIT License.