nats

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2021 License: Apache-2.0 Imports: 5 Imported by: 1

README

Grav Transport: NATS

This is a streaming transport plugin for Grav that uses NATS.

Connections are managed by the Transport object.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

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

Conn implements transport.TopicConnection and represents a subscribe/send pair for a NATS topic

func (*Conn) Close

func (c *Conn) Close()

Close closes the underlying connection

func (*Conn) Start

func (c *Conn) Start(pod *grav.Pod)

Start begins the receiving of messages

type Transport

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

Transport is a transport that connects Grav nodes via standard websockets

func New

func New(endpoint string) (*Transport, error)

New creates a new websocket transport

func (*Transport) ConnectBridgeTopic

func (t *Transport) ConnectBridgeTopic(topic string) (grav.TopicConnection, error)

ConnectBridgeTopic connects to a topic if the transport is a bridge

func (*Transport) CreateConnection

func (t *Transport) CreateConnection(endpoint string) (grav.Connection, error)

CreateConnection adds an endpoint to emit messages to

func (*Transport) Setup

func (t *Transport) Setup(opts *grav.TransportOpts, connFunc grav.ConnectFunc, findFunc grav.FindFunc) error

Setup sets up the transport

func (*Transport) Type

func (t *Transport) Type() grav.TransportType

Type returns the transport's type

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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