v0.0.0-...-3b3caa0 Latest Latest

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

Go to latest
Published: Jul 12, 2024 License: Apache-2.0 Imports: 10 Imported by: 8




This section is empty.


This section is empty.


This section is empty.


type FakeNATSClient

type FakeNATSClient struct {
	// contains filtered or unexported fields

func NewFakeClient

func NewFakeClient() *FakeNATSClient

func (*FakeNATSClient) Close

func (f *FakeNATSClient) Close()

func (*FakeNATSClient) Connect

func (f *FakeNATSClient) Connect(urls []string) (chan struct{}, error)

func (*FakeNATSClient) OnPing

func (f *FakeNATSClient) OnPing(onPingCallback func() bool)

func (*FakeNATSClient) Ping

func (f *FakeNATSClient) Ping() bool

func (*FakeNATSClient) Publish

func (f *FakeNATSClient) Publish(subject string, payload []byte) error

func (*FakeNATSClient) PublishRequest

func (f *FakeNATSClient) PublishRequest(subject, reply string, payload []byte) error

func (*FakeNATSClient) PublishedMessageCount

func (f *FakeNATSClient) PublishedMessageCount() int

func (*FakeNATSClient) PublishedMessages

func (f *FakeNATSClient) PublishedMessages(subject string) []*nats.Msg

func (*FakeNATSClient) QueueSubscribe

func (f *FakeNATSClient) QueueSubscribe(subject, queue string, callback nats.MsgHandler) (*nats.Subscription, error)

func (*FakeNATSClient) Request

func (f *FakeNATSClient) Request(subj string, data []byte, timeout time.Duration) (m *nats.Msg, err error)

func (*FakeNATSClient) Reset

func (f *FakeNATSClient) Reset()

func (*FakeNATSClient) SetPingInterval

func (f *FakeNATSClient) SetPingInterval(interval time.Duration)

func (*FakeNATSClient) SubjectCallbacks

func (f *FakeNATSClient) SubjectCallbacks(subject string) []nats.MsgHandler

func (*FakeNATSClient) Subscribe

func (f *FakeNATSClient) Subscribe(subject string, callback nats.MsgHandler) (*nats.Subscription, error)

func (*FakeNATSClient) SubscriptionCount

func (f *FakeNATSClient) SubscriptionCount() int

func (*FakeNATSClient) Subscriptions

func (f *FakeNATSClient) Subscriptions(subject string) []*nats.Subscription

func (*FakeNATSClient) Unsubscribe

func (f *FakeNATSClient) Unsubscribe(subscription *nats.Subscription) error

func (*FakeNATSClient) WhenPublishing

func (f *FakeNATSClient) WhenPublishing(subject string, callback func(*nats.Msg) error)

func (*FakeNATSClient) WhenSubscribing

func (f *FakeNATSClient) WhenSubscribing(subject string, callback func(nats.MsgHandler) error)

type NATSClient

type NATSClient interface {
	Connect(urls []string) (chan struct{}, error)
	SetPingInterval(interval time.Duration)
	Ping() bool
	Unsubscribe(sub *nats.Subscription) error

	// Via nats-io/nats.Conn
	Publish(subject string, data []byte) error
	PublishRequest(subj, reply string, data []byte) error
	Request(subj string, data []byte, timeout time.Duration) (m *nats.Msg, err error)
	Subscribe(subject string, handler nats.MsgHandler) (*nats.Subscription, error)
	QueueSubscribe(subject, queue string, handler nats.MsgHandler) (*nats.Subscription, error)

func NewClient

func NewClient() NATSClient

func NewClientWithTLSConfig

func NewClientWithTLSConfig(tlsConfig *tls.Config) NATSClient

type NATSClientRunner

type NATSClientRunner struct {
	// contains filtered or unexported fields

func NewClientRunner

func NewClientRunner(addresses, username, password string, logger lager.Logger, client NATSClient) NATSClientRunner

func (NATSClientRunner) Run

func (runner NATSClientRunner) Run(signals <-chan os.Signal, ready chan<- struct{}) error


Path Synopsis

Jump to

Keyboard shortcuts

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