adapter

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: 15 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidPacket = errors.New("adapter: invalid packet")
)

Functions

This section is empty.

Types

type AdapterConnector

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

func NewAdapterConnector

func NewAdapterConnector(options *Options) *AdapterConnector

func NewAdapterConnectorWithClient added in v0.0.6

func NewAdapterConnectorWithClient(client *core.Client, options *Options) *AdapterConnector

func (*AdapterConnector) BatchPublish added in v0.0.2

func (ac *AdapterConnector) BatchPublish(requests []*Request) (bool, int32, error)

func (*AdapterConnector) Connect

func (ac *AdapterConnector) Connect(host string, options *core.Options) error

func (*AdapterConnector) Disconnect

func (ac *AdapterConnector) Disconnect() error

func (*AdapterConnector) GetEndpoint added in v0.0.18

func (ac *AdapterConnector) GetEndpoint() (*core.Endpoint, error)

func (*AdapterConnector) Publish

func (ac *AdapterConnector) Publish(eventName string, payload []byte, meta map[string]interface{}) error

func (*AdapterConnector) PublishComplete added in v1.0.7

func (ac *AdapterConnector) PublishComplete() <-chan struct{}

func (*AdapterConnector) PublishPending added in v1.0.7

func (ac *AdapterConnector) PublishPending() int

func (*AdapterConnector) Register added in v0.0.7

func (ac *AdapterConnector) Register(component string, adapterID string, name string) error

func (*AdapterConnector) Release added in v0.0.16

func (ac *AdapterConnector) Release()

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) 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 {
	Endpoint            string
	Domain              string
	Key                 *keyring.KeyInfo
	BatchSize           int
	PingInterval        time.Duration
	MaxPingsOutstanding int
	MaxReconnects       int
	ReconnectHandler    func()
	DisconnectHandler   func()
	Verbose             bool
}

func NewOptions

func NewOptions() *Options

type Request added in v0.0.2

type Request struct {
	IsCompleted bool
	Key         []byte
	EventName   string
	Payload     []byte
}

Jump to

Keyboard shortcuts

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