Documentation
¶
Index ¶
- func GenericCommandSubscriber(logger *slog.Logger, natsClient *NatsConnection, commandName string, ...)
- func GenericNfcSubscriber(logger *slog.Logger, natsClient *NatsConnection, tagId string, ...)
- func GenericScheduleSubscriber(logger *slog.Logger, natsClient *NatsConnection, scheduleName string, ...)
- func GenericStateSubscriber(logger *slog.Logger, natsClient *NatsConnection, entityId string, ...)
- func GenericZhaSubscriber(logger *slog.Logger, natsClient *NatsConnection, deviceIeee string, ...)
- func GenericZwaveLSubscriber(logger *slog.Logger, natsClient *NatsConnection, deviceId string, scene bool, ...)
- type NatsConnection
- func (n *NatsConnection) Close()
- func (n *NatsConnection) Connect() error
- func (n *NatsConnection) Publish(ctx context.Context, subject string, payload []byte, ...)
- func (n *NatsConnection) Stream(ctx context.Context, subject string) (stream jetstream.Stream, consumer jetstream.Consumer, err error)
- func (n *NatsConnection) Subscribe(subject string) (sub *nats.Subscription, ch chan *nats.Msg, err error)
- func (n *NatsConnection) WithConnectionOption(opt nats.Option) *NatsConnection
- func (n *NatsConnection) WithHostName(hostname string) *NatsConnection
- func (n *NatsConnection) WithJetstream(jetstream bool) *NatsConnection
- func (n *NatsConnection) WithJetstreamOption(opt jetstream.JetStreamOpt) *NatsConnection
- func (n *NatsConnection) WithPort(port string) *NatsConnection
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenericCommandSubscriber ¶ added in v0.13.0
func GenericNfcSubscriber ¶ added in v0.13.0
func GenericScheduleSubscriber ¶ added in v0.13.0
func GenericScheduleSubscriber(logger *slog.Logger, natsClient *NatsConnection, scheduleName string, handler func() error)
func GenericStateSubscriber ¶ added in v0.13.0
func GenericZhaSubscriber ¶ added in v0.13.0
func GenericZwaveLSubscriber ¶ added in v0.13.0
Types ¶
type NatsConnection ¶
type NatsConnection struct { HostName string Port string UseJetstream bool Conn *nats.Conn JS jetstream.JetStream // contains filtered or unexported fields }
func DefaultNatsConnection ¶
func DefaultNatsConnection() *NatsConnection
func (*NatsConnection) Close ¶
func (n *NatsConnection) Close()
func (*NatsConnection) Connect ¶
func (n *NatsConnection) Connect() error
func (*NatsConnection) Publish ¶
func (n *NatsConnection) Publish(ctx context.Context, subject string, payload []byte, opts ...jetstream.PublishOpt)
func (*NatsConnection) Subscribe ¶
func (n *NatsConnection) Subscribe(subject string) (sub *nats.Subscription, ch chan *nats.Msg, err error)
func (*NatsConnection) WithConnectionOption ¶
func (n *NatsConnection) WithConnectionOption(opt nats.Option) *NatsConnection
func (*NatsConnection) WithHostName ¶
func (n *NatsConnection) WithHostName(hostname string) *NatsConnection
func (*NatsConnection) WithJetstream ¶
func (n *NatsConnection) WithJetstream(jetstream bool) *NatsConnection
func (*NatsConnection) WithJetstreamOption ¶
func (n *NatsConnection) WithJetstreamOption(opt jetstream.JetStreamOpt) *NatsConnection
func (*NatsConnection) WithPort ¶
func (n *NatsConnection) WithPort(port string) *NatsConnection
Click to show internal directories.
Click to hide internal directories.