Documentation ¶
Overview ¶
Package infrastructure contains the structs and interfaces needed to manage replication slots
Index ¶
- type Manager
- type PostgresManager
- func (sm PostgresManager) Create(ctx context.Context, slot ReplicationSlot) error
- func (sm PostgresManager) Delete(ctx context.Context, slot ReplicationSlot) error
- func (sm PostgresManager) List(ctx context.Context, config *v1.ReplicationSlotsConfiguration) (ReplicationSlotList, error)
- func (sm PostgresManager) String() string
- func (sm PostgresManager) Update(ctx context.Context, slot ReplicationSlot) error
- type ReplicationSlot
- type ReplicationSlotList
- type SlotType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager interface { // List the available replication slots List(ctx context.Context, config *apiv1.ReplicationSlotsConfiguration) (ReplicationSlotList, error) // Update the replication slot Update(ctx context.Context, slot ReplicationSlot) error // Create the replication slot Create(ctx context.Context, slot ReplicationSlot) error // Delete the replication slot Delete(ctx context.Context, slot ReplicationSlot) error }
Manager abstracts the operations that need to be sent to the database instance for the management of Replication Slots
func NewPostgresManager ¶
NewPostgresManager returns an implementation of Manager for postgres
type PostgresManager ¶
type PostgresManager struct {
// contains filtered or unexported fields
}
PostgresManager is a Manager for a database instance
func (PostgresManager) Create ¶
func (sm PostgresManager) Create(ctx context.Context, slot ReplicationSlot) error
Create the replication slot
func (PostgresManager) Delete ¶
func (sm PostgresManager) Delete(ctx context.Context, slot ReplicationSlot) error
Delete the replication slot
func (PostgresManager) List ¶
func (sm PostgresManager) List( ctx context.Context, config *v1.ReplicationSlotsConfiguration, ) (ReplicationSlotList, error)
List the available replication slots
func (PostgresManager) String ¶
func (sm PostgresManager) String() string
func (PostgresManager) Update ¶
func (sm PostgresManager) Update(ctx context.Context, slot ReplicationSlot) error
Update the replication slot
type ReplicationSlot ¶
type ReplicationSlot struct { SlotName string `json:"slotName,omitempty"` Type SlotType `json:"type,omitempty"` Active bool `json:"active"` RestartLSN string `json:"restartLSN,omitempty"` IsHA bool `json:"isHA,omitempty"` }
ReplicationSlot represents a single replication slot
type ReplicationSlotList ¶
type ReplicationSlotList struct {
Items []ReplicationSlot
}
ReplicationSlotList contains a list of replication slots
func (ReplicationSlotList) Get ¶
func (sl ReplicationSlotList) Get(name string) *ReplicationSlot
Get returns the ReplicationSlot with the required name if present in the ReplicationSlotList
func (ReplicationSlotList) Has ¶
func (sl ReplicationSlotList) Has(name string) bool
Has returns true is a ReplicationSlot with the required name if present in the ReplicationSlotList