tnats

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NatsTransporter

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

NatsTransporter implements the yarf.Transport for using Nats

func NewNatsTransporter

func NewNatsTransporter(servers string, timeout time.Duration, opts ...nats.Option) (*NatsTransporter, error)

NewNatsTransporter a constructor for the NatsTransporter

func NewNatsTransporterFromConn

func NewNatsTransporterFromConn(natsConnection *nats.Conn, timeout time.Duration) (*NatsTransporter, error)

NewNatsTransporterFromConn a constructor for the NatsTransporter using an existing nats connection

func (*NatsTransporter) Call

func (n *NatsTransporter) Call(ctx context.Context, function string, requestData []byte) (response []byte, err error)

Call implements client side call of transporter

func (*NatsTransporter) Close

func (n *NatsTransporter) Close() error

Close the nats transporter and the nats client

func (*NatsTransporter) Listen

func (n *NatsTransporter) Listen(function string, toExec func(ctx context.Context, requestData []byte) (responseData []byte)) error

Listen defines the function that will handle yarf requests

Jump to

Keyboard shortcuts

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