Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct {
// Port is the port on which the server will listen for connections. If
// zero, a random available port is used.
Port int
// StartTimeout is the maximum time to wait for the server to become ready
// to accept connections. If zero, the default timeout of 5 seconds is used.
StartTimeout time.Duration
// EnableLogging enables server logging.
EnableLogging bool
// InactivityTimeout is the maximum time to wait for a ping from a client
// before automatically shutting down. If zero, the server will not shut
// down automatically.
InactivityTimeout time.Duration
// NoListener disables the network listener, only allowing in-process
// connections to be made to this server instead.
NoListener bool
}
type Server ¶
type Server struct {
CacheStats *common.CacheStats // Cache statistics
// contains filtered or unexported fields
}
func New ¶
New initializes and starts a new NATS server with the provided options. The server only listens on the loopback interface.
func (*Server) ClientURL ¶
ClientURL returns the URL connection string clients should use to connect to this NATS server.
func (*Server) Shutdown ¶
func (s *Server) Shutdown()
Shutdown initiates the shutdown of this server.
func (*Server) WaitForShutdown ¶
func (s *Server) WaitForShutdown()
WaitForShutdown waits indefinitely for this server to have shut down.
Click to show internal directories.
Click to hide internal directories.