Documentation ¶
Index ¶
- Constants
- func CreateClient(ctx context.Context, config *NATSTransportConfig) (*nats_helper.ClientManager, error)
- type NATSTransport
- func (t *NATSTransport) CallbackProxy() compute.Callback
- func (t *NATSTransport) Client() *nats.Conn
- func (t *NATSTransport) Close(ctx context.Context) error
- func (t *NATSTransport) ComputeProxy() compute.Endpoint
- func (t *NATSTransport) CreateClient(ctx context.Context) (*nats.Conn, error)
- func (t *NATSTransport) DebugInfoProviders() []models.DebugInfoProvider
- func (t *NATSTransport) ManagementProxy() compute.ManagementEndpoint
- func (t *NATSTransport) NodeInfoDecorator() models.NodeInfoDecorator
- func (t *NATSTransport) NodeInfoPubSub() pubsub.PubSub[models.NodeState]
- func (t *NATSTransport) RegisterComputeCallback(callback compute.Callback) error
- func (t *NATSTransport) RegisterComputeEndpoint(ctx context.Context, endpoint compute.Endpoint) error
- func (t *NATSTransport) RegisterManagementEndpoint(endpoint compute.ManagementEndpoint) error
- func (t *NATSTransport) RegisterNodeInfoConsumer(ctx context.Context, infostore routing.NodeInfoStore) error
- type NATSTransportConfig
Constants ¶
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) Client ¶ added in v1.4.0
func (t *NATSTransport) Client() *nats.Conn
Client returns the existing NATS client.
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) 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
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 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 }
func (*NATSTransportConfig) Validate ¶
func (c *NATSTransportConfig) Validate() error