enats

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: MIT Imports: 9 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
	ServiceAddr string
	ClusterAddr string
	ClusterName string
	GatewayAddr string
	Gateways    []string
	Routes      []string
}

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() error

Shutdown shuts the NATS server down

func (*Service) Start

func (s *Service) Start() error

Start starts the service

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