nats

package
v0.0.0-...-2f677eb Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Driver contains all the function needed to be recognized as a libdata driver

func NewClient

func NewClient(info *ClientInfo) (*Client, error)

func (*Client) Connection

func (c *Client) Connection() *nats.Conn

func (*Client) DispatchEvent

func (c *Client) DispatchEvent(ctx context.Context, aggregate string, payload []byte) error

func (*Client) NewInbox

func (c *Client) NewInbox() string

func (*Client) Publish

func (c *Client) Publish(subject string, message []byte) error

func (*Client) Subscribe

func (c *Client) Subscribe(ctx context.Context, consumer string, stream string, subject string, function func([]byte) error) (interface{}, error)

func (*Client) SubscribeSync

func (c *Client) SubscribeSync(stream string) (libdomain.EventDispatcherSubscription, error)

type ClientInfo

type ClientInfo struct {
	URL string
}

type Subscription

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

func (*Subscription) NextMsg

func (s *Subscription) NextMsg(timeout time.Duration) ([]byte, error)

Jump to

Keyboard shortcuts

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