server

package
v1.1.1039 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetServers

func GetServers(sharConcurrency int, apiAuth authz.APIFunc, authN authn.Check, option ...ZenSharOptionApplyFn) (Server, Server, error)

GetServers returns a test NATS and SHAR server. nolint:ireturn

Types

type NatsLogger

type NatsLogger struct {
}

NatsLogger provides a simple logger that logs to console

func (*NatsLogger) Debugf

func (n *NatsLogger) Debugf(format string, v ...interface{})

Debugf logs a debug statement

func (*NatsLogger) Errorf

func (n *NatsLogger) Errorf(format string, v ...interface{})

Errorf logs an error

func (*NatsLogger) Fatalf

func (n *NatsLogger) Fatalf(format string, v ...interface{})

Fatalf logs a fatal error

func (*NatsLogger) Noticef

func (n *NatsLogger) Noticef(format string, v ...interface{})

Noticef logs a notice statement

func (*NatsLogger) Tracef

func (n *NatsLogger) Tracef(format string, v ...interface{})

Tracef logs a trace statement

func (*NatsLogger) Warnf

func (n *NatsLogger) Warnf(format string, v ...interface{})

Warnf logs a warning statement

type NatsServer added in v1.0.623

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

NatsServer is a wrapper around the nats lib server so that its lifecycle can be defined in terms of the Server interface needed by integration tests

func (*NatsServer) GetEndPoint added in v1.0.623

func (natserver *NatsServer) GetEndPoint() string

GetEndPoint returns the url of the nats endpoint

func (*NatsServer) Listen added in v1.0.623

func (natserver *NatsServer) Listen()

Listen starts an in process nats server

func (*NatsServer) Shutdown added in v1.0.623

func (natserver *NatsServer) Shutdown()

Shutdown shutsdown an in process nats server

type Server added in v1.0.623

type Server interface {
	Shutdown()
	Listen()
	GetEndPoint() string
}

Server is a general interface representing either an inprocess or in container Shar server

type ZenSharOptionApplyFn added in v1.0.514

type ZenSharOptionApplyFn func(cfg *zenOpts)

ZenSharOptionApplyFn represents a SHAR Zen Server configuration function

func WithNatsPersistHostPath added in v1.0.623

func WithNatsPersistHostPath(natsPersistHostPath string) ZenSharOptionApplyFn

WithNatsPersistHostPath will make zen-shar persist nats messages between test runs if we are running against a containerised nats server

func WithNatsServerAddress added in v1.1.670

func WithNatsServerAddress(addr string) ZenSharOptionApplyFn

WithNatsServerAddress provides a specific address for the NATS server.

func WithNatsServerImageUrl added in v1.0.623

func WithNatsServerImageUrl(imageUrl string) ZenSharOptionApplyFn

WithNatsServerImageUrl will make zen-shar start nats server in a container from the specificed image URL

func WithSharServerImageUrl added in v1.0.623

func WithSharServerImageUrl(imageUrl string) ZenSharOptionApplyFn

WithSharServerImageUrl will make zen-shar start shar server in a container from the specificed image URL

func WithSharServerTelemetry added in v1.1.848

func WithSharServerTelemetry(endpoint string) ZenSharOptionApplyFn

WithSharServerTelemetry will make zen-shar persist nats messages between test runs if we are running against a containerised nats server

func WithSharVersion added in v1.0.514

func WithSharVersion(ver string) ZenSharOptionApplyFn

WithSharVersion artificially sets the reported server version.

Jump to

Keyboard shortcuts

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