syncsequences

package
v1.23.1 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

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

func NewCmd

func NewCmd() *cobra.Command

NewCmd initializes the subscription create command

Types

type SequenceMap

type SequenceMap map[string]*int

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

Jump to

Keyboard shortcuts

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