nats

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunEmbeddedNATSServer

func RunEmbeddedNATSServer(cfg Config) (*nats.Conn, *server.Server, error)

Types

type CDCPublisher

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

func NewCDCPublisher

func NewCDCPublisher(nc *nats.Conn, url string, replicas int, stream string, maxAge time.Duration, timeout time.Duration) (*CDCPublisher, error)

func (*CDCPublisher) Publish

func (p *CDCPublisher) Publish(cs *sqlite.ChangeSet) error

type CDCSubscriber

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

func NewCDCSubscriber

func NewCDCSubscriber(node string, nc *nats.Conn, url string, stream string, policy string, db *sql.DB) (*CDCSubscriber, error)

func (*CDCSubscriber) Close

func (s *CDCSubscriber) Close()

func (*CDCSubscriber) DeliveredInfo added in v0.0.10

func (s *CDCSubscriber) DeliveredInfo(ctx context.Context, name string) ([]*jetstream.ConsumerInfo, error)

func (*CDCSubscriber) LatestSeq added in v0.0.10

func (s *CDCSubscriber) LatestSeq() uint64

func (*CDCSubscriber) RemoveConsumer added in v0.0.11

func (s *CDCSubscriber) RemoveConsumer(ctx context.Context, name string) error

type Config

type Config struct {
	Name       string
	Port       int
	StoreDir   string
	User       string
	Pass       string
	File       string
	EnableLogs bool
}

type SequenceProvider added in v0.0.10

type SequenceProvider interface {
	LatestSeq() uint64
}

type Snapshotter added in v0.0.9

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

func NewSnapshotter added in v0.0.9

func NewSnapshotter(ctx context.Context, nc *nats.Conn, url string, replicas int, stream string, dsn string, memdb bool, interval time.Duration) (*Snapshotter, error)

func (*Snapshotter) LatestSnapshot added in v0.0.11

func (s *Snapshotter) LatestSnapshot(ctx context.Context) (uint64, io.ReadCloser, error)

func (*Snapshotter) LatestSnapshotSequence added in v0.0.11

func (s *Snapshotter) LatestSnapshotSequence(ctx context.Context) (uint64, error)

func (*Snapshotter) SetSeqProvider added in v0.0.10

func (s *Snapshotter) SetSeqProvider(p SequenceProvider)

func (*Snapshotter) TakeSnapshot added in v0.0.9

func (s *Snapshotter) TakeSnapshot(ctx context.Context, dsn string, memdb bool) (sequence uint64, err error)

Jump to

Keyboard shortcuts

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