core

package
v1.0.12 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2022 License: MIT Imports: 4 Imported by: 17

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
}

func NewClient

func NewClient() *Client

func (*Client) Connect

func (client *Client) Connect(host string, options *Options) error

func (*Client) ConnectToEndpoint added in v0.0.18

func (client *Client) ConnectToEndpoint(name string, domain string, options *EndpointOptions) (*Endpoint, error)

func (*Client) Disconnect

func (client *Client) Disconnect()

func (*Client) GetConnection

func (client *Client) GetConnection() *nats.Conn

func (*Client) GetEndpoint added in v0.0.18

func (client *Client) GetEndpoint(name string) *Endpoint

type Endpoint added in v0.0.18

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

func NewEndpoint added in v0.0.18

func NewEndpoint(client *Client, name string, domain string, options *EndpointOptions) *Endpoint

func (*Endpoint) Channel added in v0.0.18

func (endpoint *Endpoint) Channel(channelName string) string

func (*Endpoint) Connect added in v0.0.18

func (endpoint *Endpoint) Connect() error

func (*Endpoint) GetConnection added in v0.0.18

func (endpoint *Endpoint) GetConnection() *nats.Conn

func (*Endpoint) GetJetStreamContext added in v1.0.10

func (endpoint *Endpoint) GetJetStreamContext() nats.JetStreamContext

type EndpointOptions added in v0.0.18

type EndpointOptions struct {
}

func NewEndpointOptions added in v0.0.18

func NewEndpointOptions() *EndpointOptions

type EventBus

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

func NewEventBus

func NewEventBus(host string, handler EventBusHandler, options EventBusOptions) *EventBus

func (*EventBus) Close

func (eb *EventBus) Close()

func (*EventBus) Connect

func (eb *EventBus) Connect() error

func (*EventBus) GetConnection

func (eb *EventBus) GetConnection() *nats.Conn

func (*EventBus) GetJetStreamContext added in v1.0.10

func (eb *EventBus) GetJetStreamContext() nats.JetStreamContext

func (*EventBus) ReconnectHandler

func (eb *EventBus) ReconnectHandler(natsConn *nats.Conn)

type EventBusHandler

type EventBusHandler struct {
	Reconnect  func(natsConn *nats.Conn)
	Disconnect func(natsConn *nats.Conn)
}

type EventBusOptions

type EventBusOptions struct {
	PingInterval        time.Duration
	MaxPingsOutstanding int
	MaxReconnects       int
}

type Options

type Options struct {
	AppID               string
	AppKey              string
	PingInterval        time.Duration
	MaxPingsOutstanding int
	MaxReconnects       int
	ReconnectHandler    func()
	DisconnectHandler   func()
}

func NewOptions

func NewOptions() *Options

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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