nats

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartServer

func StartServer(timeWindow int) (*natsserver.Server, error)

Types

type Client

type Client struct {
	nats.JetStreamContext
}

func GetConsumer

func GetConsumer() *Client

func GetPublisher

func GetPublisher() *Client

func (*Client) ConsumeMsg

func (client *Client) ConsumeMsg() (chan MessageWithContext, error)

func (*Client) PublishMsg

func (client *Client) PublishMsg(ctx context.Context, id, msg string) error

func (*Client) SetJetStreamContext

func (client *Client) SetJetStreamContext(addr string) error

type MessageWithContext

type MessageWithContext struct {
	Ctx  context.Context
	Data []byte
}

Jump to

Keyboard shortcuts

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