https://github.com/osapi-io/nats-server
A Go package for running an embedded NATS server.
https://github.com/osapi-io/nats-server
golang messaging nats-jetstream nats-server osapi
Last synced: 8 days ago
JSON representation
A Go package for running an embedded NATS server.
- Host: GitHub
- URL: https://github.com/osapi-io/nats-server
- Owner: osapi-io
- License: mit
- Created: 2025-02-07T04:39:20.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2026-05-21T19:21:32.000Z (13 days ago)
- Last Synced: 2026-05-22T04:29:59.849Z (13 days ago)
- Topics: golang, messaging, nats-jetstream, nats-server, osapi
- Language: Go
- Homepage:
- Size: 313 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: docs/contributing.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
[](https://github.com/osapi-io/nats-server/releases/latest)
[](https://codecov.io/gh/osapi-io/nats-server)
[](https://goreportcard.com/report/github.com/osapi-io/nats-server)
[](LICENSE)
[](https://github.com/osapi-io/nats-server/actions/workflows/go.yml)
[](https://github.com/goreleaser)
[](https://conventionalcommits.org)
[](https://nats.io)
[](https://just.systems)

[](https://pkg.go.dev/github.com/osapi-io/nats-server/pkg/server)
# NATS Server
A Go package for running an embedded NATS server.
## 📦 Install
```bash
go get github.com/osapi-io/nats-server
```
## ✨ Features
See the [server docs](docs/server/README.md) for quick start, authentication,
and per-feature reference.
| Feature | Description | Docs | Source |
| -------------------- | --------------------------------------------------------- | ------------------------------------------ | ----------------------------------------- |
| Lifecycle management | Non-blocking `Start()` / graceful `Stop()` with readiness | [docs](docs/server/lifecycle.md) | [`server.go`](pkg/server/server.go) |
| slog integration | Adapts `slog.Logger` to the NATS server logging interface | [docs](docs/server/logging.md) | [`logger.go`](pkg/server/logger.go) |
| Configuration | Options for host, port, store dir, auth, and timeouts | [docs](docs/server/configuration.md) | [`types.go`](pkg/server/types.go) |
## 📋 Examples
Each example is a standalone Go program you can read and run.
| Example | What it shows |
| ------------------------------------------------ | ---------------------------------------- |
| [auth-none](examples/auth-none/main.go) | Start a server without authentication |
| [auth-user-pass](examples/auth-user-pass/main.go) | Server with username/password auth |
| [auth-nkeys](examples/auth-nkeys/main.go) | Server with NKey authentication |
| [simple-server](examples/simple-server/main.go) | Minimal server startup and shutdown |
## 📖 Documentation
See the [package documentation][] on pkg.go.dev for API details.
## 🤝 Contributing
See the [Development](docs/development.md) guide for prerequisites, setup,
and conventions. See the [Contributing](docs/contributing.md) guide before
submitting a PR.
## 📄 License
The [MIT][] License.
[package documentation]: https://pkg.go.dev/github.com/osapi-io/nats-server/pkg/server
[MIT]: LICENSE