transport

package
v1.6.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const NATSServerDefaultTLSTimeout = 10

Variables

This section is empty.

Functions

func CreateClient added in v1.3.0

func CreateClient(ctx context.Context, config *NATSTransportConfig) (*nats_helper.ClientManager, error)

Types

type NATSTransport

type NATSTransport struct {
	Config *NATSTransportConfig
	// contains filtered or unexported fields
}

func NewNATSTransport

func NewNATSTransport(ctx context.Context,
	config *NATSTransportConfig) (*NATSTransport, error)

func (*NATSTransport) Close

func (t *NATSTransport) Close(ctx context.Context) error

Close closes the transport layer.

func (*NATSTransport) CreateClient added in v1.4.0

func (t *NATSTransport) CreateClient(ctx context.Context) (*nats.Conn, error)

CreateClient creates a new NATS client.

func (*NATSTransport) DebugInfoProviders

func (t *NATSTransport) DebugInfoProviders() []models.DebugInfoProvider

DebugInfoProviders returns the debug info of the NATS transport layer

type NATSTransportConfig

type NATSTransportConfig struct {
	NodeID            string
	Host              string
	Port              int
	AdvertisedAddress string
	Orchestrators     []string
	IsRequesterNode   bool

	// StoreDir is the directory where the NATS server will store its data
	StoreDir string

	// AuthSecret is a secret string that clients must use to connect. NATS servers
	// must supply this config, while clients can also supply it as the user part
	// of their Orchestrator URL.
	AuthSecret string

	// Cluster config for requester nodes to connect with each other
	ClusterName              string
	ClusterPort              int
	ClusterAdvertisedAddress string
	ClusterPeers             []string

	// TLS
	ServerTLSCert    string
	ServerTLSKey     string
	ServerTLSTimeout int

	// Used by the Nats Client when node acts as orchestrator
	ServerTLSCACert string

	// Used by the Nats Client when node acts as compute
	ClientTLSCACert string

	// Used to configure Orchestrator (actually the NATS server) to run behind
	// a reverse proxy
	ServerSupportReverseProxy bool

	// Used to configure compute node nats client to require TLS connection
	ComputeClientRequireTLS bool
}

func (*NATSTransportConfig) Validate

func (c *NATSTransportConfig) Validate() error

Jump to

Keyboard shortcuts

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