transport

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const NodeInfoSubjectPrefix = "node.info."

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) CallbackProxy

func (t *NATSTransport) CallbackProxy() compute.Callback

CallbackProxy returns the callback proxy.

func (*NATSTransport) Close

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

Close closes the transport layer.

func (*NATSTransport) ComputeProxy

func (t *NATSTransport) ComputeProxy() compute.Endpoint

ComputeProxy returns the compute proxy.

func (*NATSTransport) DebugInfoProviders

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

DebugInfoProviders returns the debug info of the NATS transport layer

func (*NATSTransport) ManagementProxy added in v1.2.3

func (t *NATSTransport) ManagementProxy() compute.ManagementEndpoint

RegistrationProxy returns the previoously created registration proxy.

func (*NATSTransport) NodeInfoDecorator

func (t *NATSTransport) NodeInfoDecorator() models.NodeInfoDecorator

NodeInfoDecorator returns the node info decorator.

func (*NATSTransport) NodeInfoPubSub

func (t *NATSTransport) NodeInfoPubSub() pubsub.PubSub[models.NodeState]

NodeInfoPubSub returns the node info pubsub.

func (*NATSTransport) RegisterComputeCallback

func (t *NATSTransport) RegisterComputeCallback(callback compute.Callback) error

RegisterComputeCallback registers a compute callback with the transport layer.

func (*NATSTransport) RegisterComputeEndpoint

func (t *NATSTransport) RegisterComputeEndpoint(ctx context.Context, endpoint compute.Endpoint) error

RegisterComputeEndpoint registers a compute endpoint with the transport layer.

func (*NATSTransport) RegisterManagementEndpoint added in v1.2.3

func (t *NATSTransport) RegisterManagementEndpoint(endpoint compute.ManagementEndpoint) error

RegisterManagementEndpoint registers a requester endpoint with the transport layer

func (*NATSTransport) RegisterNodeInfoConsumer added in v1.2.2

func (t *NATSTransport) RegisterNodeInfoConsumer(ctx context.Context, infostore routing.NodeInfoStore) error

type NATSTransportConfig

type NATSTransportConfig struct {
	NodeID            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
}

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