embeddednats

package
v0.3.16 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2025 License: MIT Imports: 6 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*options)

func WithDirectory

func WithDirectory(dir string) Option

func WithNATSServerOptions

func WithNATSServerOptions(natsServerOptions *server.Options) Option

func WithShouldClearData

func WithShouldClearData(shouldClearData bool) Option

type Server

type Server struct {
	NatsServer *server.Server
}

func New

func New(ctx context.Context, opts ...Option) (*Server, error)

New creates a new embedded NATS server. Will automatically start the server and clean up when the context is cancelled.

func (*Server) Client

func (n *Server) Client() (*nats.Conn, error)

func (*Server) Close

func (n *Server) Close() error

func (*Server) WaitForServer

func (n *Server) WaitForServer()

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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