nats

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrConnectCode        = "11000"
	ErrEncodedConnCode    = "11000"
	ErrPublishCode        = "11001"
	ErrPublishRequestCode = "11001"
	ErrQueueSubscribeCode = "11001"
)

Variables

This section is empty.

Functions

func CreateResource

func CreateResource(m *mesheryv1alpha1.Broker, scheme *runtime.Scheme) *appsv1.Deployment

CreateDeployment returns a meshsync Deployment object

func ErrConnect

func ErrConnect(err interface{}) error

func ErrEncodedConn

func ErrEncodedConn(err error) error

func ErrPublish

func ErrPublish(err interface{}) error

func ErrPublishRequest

func ErrPublishRequest(err error) error

func ErrQueueSubscribe

func ErrQueueSubscribe(err interface{}) error

func GetResource

func GetResource(m *mesheryv1alpha1.Broker) runtime.Object

Types

type Nats

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

Nats will implement Nats subscribe and publish functionality

func New

func New(serverURL string) (*Nats, error)

New - constructor

func (*Nats) Publish

func (n *Nats) Publish(subject string, message interface{}) error

Publish - to publish messages

func (*Nats) PublishWithCallback

func (n *Nats) PublishWithCallback(request, reply string, message interface{}) error

PublishWithCallback - will implement the request-reply mechanisms Arguments: request - the subject to which publish a request reply - this string will be used by the replier to publish replies message - message send by the requestor to replier TODO Ques: After this the requestor have to subscribe to the reply subject

func (*Nats) Subscribe

func (n *Nats) Subscribe(subject, queue string) error

Subscribe - for subscribing messages TODO Ques: Do we want to unsubscribe TODO will the method-user just subsribe, how will it handle the received messages?

func (*Nats) SubscribeWithHandler

func (n *Nats) SubscribeWithHandler(subject, queue string) error

SubscribeWithHandler - for handling request-reply protocol request is the subject to which the this thing is listening when there will be a request

Jump to

Keyboard shortcuts

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