nats

package
v0.0.0-...-43a96cf Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 27 Imported by: 1

Documentation

Index

Constants

View Source
const HealthCheckTokenPrefix = "HEALTHCHECK-"
View Source
const PRNCount = 20

Variables

This section is empty.

Functions

func ConnectivityCheck

func ConnectivityCheck(c *config.EventGatewayConfig) error

func GenerateHealthCheckCredentials

func GenerateHealthCheckCredentials(c *config.EventGatewayConfig) error

func ReadHealthCheckCredentials

func ReadHealthCheckCredentials(c *config.EventGatewayConfig) (string, error)

func ServerWithNATSConfig

func ServerWithNATSConfig(opts ...NATSdConfigurator) (*natsd.Server, error)

ServerWithNATSConfig configures an embedded NATS server with a custom set of NATS config options. It's intended to be used in tests where we want to test some aspect of the system without needing all of Automate running

func Spawn

Spawn starts an embedded NATS server with all the Automate integrations enabled.

Types

type NATSdConfigurator

type NATSdConfigurator func(*natsd.Options) error

NATSdConfigurator is a functional-options-pattern function that configures the NATS server.

func WithNATSA2AuthIntegration

func WithNATSA2AuthIntegration(c *config.EventGatewayConfig) NATSdConfigurator

WithA2Auth returns a NATSdConfigurator that configures the NATS server to use A2's authN and authZ

func WithNATSFrontEndCerts

func WithNATSFrontEndCerts(c *config.EventGatewayConfig) NATSdConfigurator

WithNATSFrontEndCerts returns a NATSdConfigurator that configures the NATS server to use the frontend TLS certs set on the EventGatewayConfig. Multiple certificates can be used; WithNATSFrontEndCerts will call tls.Config.BuildNameToCertificate() so that server name indication (SNI) will work.

func WithNATSGateway

func WithNATSGateway(c *config.EventGatewayConfig) NATSdConfigurator

WithNATSGateway returns a NATSdConfigurator that configures the NATS server to use the NATS gateway feature to connect to the internal event service.

func WithNATSHTTPMonitoringDisabled

func WithNATSHTTPMonitoringDisabled(c *config.EventGatewayConfig) NATSdConfigurator

WithNATSHTTPMonitoringDisabled disables the HTTP(S) monitoring servers in NATS.

func WithNATSListenOpts

func WithNATSListenOpts(c *config.EventGatewayConfig) NATSdConfigurator

WithNATSListenOpts returns a NATSdConfigurator that sets the listen host and port as set in the EventGatewayConfig

func WithNATSLogging

func WithNATSLogging(c *config.EventGatewayConfig) NATSdConfigurator

WithNATSLogging returns a NATSdConfigurator that makes NATS log in a way that kinda matches the log level set in the EventGatewayConfig. It only "kinda" matches because NATS only lets us turn debug and trace logging on or off, so we turn them both on for debug and off for log level info and higher.

Jump to

Keyboard shortcuts

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