natsstreaming

package
v0.0.0-...-420d27c Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Ack

type Ack func() error

Ack callback return ack handler

type Callback

type Callback func(data []byte, ack Ack) error

Callback callback function when message received

type Client

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

Client define client implementation for nats streaming

func NewNatsStreamingClient

func NewNatsStreamingClient(opt ClientOption) (c *Client, err error)

NewNatsStreamingClient create nats streaming client instance

func (*Client) Close

func (c *Client) Close() (err error)

Close close nats streaming connection

func (*Client) Emit

func (c *Client) Emit(topic string, payload []byte) (err error)

Emit emit/publish to any topic on nats streaming cluster

func (*Client) Listen

func (c *Client) Listen(topic string, durable string, handler Callback) (listenerValue ListenerValue, err error)

Listen listen/publish to any topic on nats streaming cluster

type ClientOption

type ClientOption struct {
	ClusterID string
	ClientID  string
	Host      string
	Port      uint64
}

ClientOption natsstreaming client options

type ListenerValue

type ListenerValue struct {
	Unsubscribe func() error
}

ListenerValue listener return value

type Message

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

Message callback return message

Jump to

Keyboard shortcuts

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