enats

package
v1.4.7 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Debug            bool
	Trace            bool
	Name             string
	ServiceAddr      string
	ClusterAddr      string
	ClusterName      string
	GatewayAddr      string
	GatewayAdvertise string
	Gateways         []string
	Routes           []string
	JetStream        bool
	StoreDir         string
	// Seconds to wait for JetStream to become ready (can take a lot of time when connecting to a cluster)
	JetStreamReadyTimeout int
}

Config represents NATS service configuration

func NewConfig

func NewConfig() Config

NewConfig returns defaults for NATSServiceConfig

type LogEntry

type LogEntry struct {
	*log.Entry
}

LogEntry represents LoggerV2 decorator for nats server logger

func (*LogEntry) Noticef

func (e *LogEntry) Noticef(format string, v ...interface{})

Noticef is an alias for Infof

func (*LogEntry) Tracef

func (e *LogEntry) Tracef(format string, v ...interface{})

Tracef is an alias for Debugf

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service represents NATS service

func NewService

func NewService(c *Config) *Service

NewService returns an instance of NATS service

func (*Service) Description

func (s *Service) Description() string

func (*Service) Shutdown

func (s *Service) Shutdown(ctx context.Context) error

Shutdown shuts the NATS server down

func (*Service) Start

func (s *Service) Start() error

Start starts the service

func (*Service) WaitJetStreamReady added in v1.4.7

func (s *Service) WaitJetStreamReady(maxSeconds int) error

func (*Service) WaitReady

func (s *Service) WaitReady() error

WaitReady waits while NATS server is starting

Jump to

Keyboard shortcuts

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