Documentation ¶
Overview ¶
Package syncsequences contains the implementation of the kubectl cnpg subscription sync-sequences command
Package syncsequences contains the implementation of the kubectl cnpg subscription sync-sequences command
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateSyncScript ¶
func CreateSyncScript(source, destination SequenceMap, offset int) string
CreateSyncScript creates a SQL script to synchronize the sequences in the destination database with the status of the source database
Types ¶
type SequenceMap ¶
SequenceMap is a map between a qualified sequence name and its current value
func GetSequenceStatus ¶
func GetSequenceStatus(ctx context.Context, clusterName string, connectionString string) (SequenceMap, error)
GetSequenceStatus gets the status of the sequences while being connected to a pod of a cluster to the specified connection string
type SequenceStatus ¶
type SequenceStatus struct { // The name of the sequence Name string `json:"sq_name"` // The namespace where the sequence is defined Namespace string `json:"sq_namespace"` // The last value emitted from the sequence Value *int `json:"sq_value"` }
SequenceStatus represent the status of a sequence in a certain moment
func (*SequenceStatus) QualifiedName ¶
func (status *SequenceStatus) QualifiedName() string
QualifiedName gets the qualified name of this sequence