Documentation
¶
Overview ¶
Package pgflonats provides NATS integration for PostgreSQL replication state management.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NATSClient ¶
type NATSClient struct {
// contains filtered or unexported fields
}
NATSClient represents a client for interacting with NATS
func NewNATSClient ¶
func NewNATSClient(url, stream, group string) (*NATSClient, error)
NewNATSClient creates a new NATS client with the specified configuration, setting up the connection, main stream, and state bucket.
func (*NATSClient) GetState ¶
func (nc *NATSClient) GetState() (State, error)
GetState retrieves the last saved state from NATS, initializing a new state if none is found.
func (*NATSClient) JetStream ¶
func (nc *NATSClient) JetStream() nats.JetStreamContext
JetStream returns the JetStream context.
func (*NATSClient) PublishMessage ¶
func (nc *NATSClient) PublishMessage(subject string, data []byte) error
PublishMessage publishes a message to the specified NATS subject.
func (*NATSClient) SaveState ¶
func (nc *NATSClient) SaveState(state State) error
SaveState saves the current replication state to NATS.
Click to show internal directories.
Click to hide internal directories.