sub

package
v0.0.0-...-1649e63 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Subscriber

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

func NewSubscriber

func NewSubscriber(
	conn *nats.Conn,
	sc SubscriberSource,
	log *slog.Logger,
	timeout time.Duration,
) *Subscriber

func (*Subscriber) Subscribe

func (s *Subscriber) Subscribe() error

type SubscriberChangedEvent

type SubscriberChangedEvent struct {
	ID      int    `json:"id"`
	Type    string `json:"type"`
	Payload string `json:"payload"`
}

type SubscriberDeleter

type SubscriberDeleter interface {
	Delete(ctx context.Context, sub subscriber.Subscriber) error
}

type SubscriberSaver

type SubscriberSaver interface {
	Save(ctx context.Context, sub subscriber.Subscriber) error
}

type SubscriberSource

type SubscriberSource interface {
	SubscriberSaver
	SubscriberDeleter
}

Jump to

Keyboard shortcuts

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