types

package
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2026 License: PostgreSQL Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockCountComposite

type BlockCountComposite struct {
	NodePosition int64 `db:"node_position"`
	RangeStart   any   `db:"range_start"`
	RangeEnd     any   `db:"range_end"`
	Count        int64 `db:"cnt"`
}

BlockCountComposite contains the row count for a block in a table with a composite primary key.

type BlockCountSimple

type BlockCountSimple struct {
	NodePosition int64 `db:"node_position"`
	RangeStart   any   `db:"range_start"`
	RangeEnd     any   `db:"range_end"`
	Count        int64 `db:"count"`
}

BlockCountSimple contains the row count for a block in a table with a simple primary key.

type BlockRange

type BlockRange struct {
	NodePosition int64 `db:"node_position"`
	RangeStart   []any `db:"range_start"`
	RangeEnd     []any `db:"range_end"`
}

BlockRange represents a block in the Merkle tree. The RangeStart and RangeEnd fields are of type any because they can be a single value or a composite type.

type BlockRangeWithCount

type BlockRangeWithCount struct {
	NodePosition int64 `db:"node_position"`
	RangeStart   []any `db:"range_start"`
	RangeEnd     []any `db:"range_end"`
	Count        int64 `db:"count"`
}

type ClusterConfig

type ClusterConfig struct {
	JSONVersion string `json:"json_version"`
	ClusterName string `json:"cluster_name"`
	LogLevel    string `json:"log_level"`
	UpdateDate  string `json:"update_date"`
	PGEdge      struct {
		PGVersion int         `json:"pg_version"`
		AutoStart string      `json:"auto_start"`
		Spock     SpockConfig `json:"spock"`
		Databases []Database  `json:"databases"`
	} `json:"pgedge"`
	NodeGroups []NodeGroup `json:"node_groups"`
}

type ColumnType

type ColumnType struct {
	ColumnName string `db:"column_name"`
	DataType   string `db:"data_type"`
}

ColumnType holds the name and data type of a column.

type Database

type Database struct {
	DBName      string `json:"db_name"`
	DBUser      string `json:"db_user"`
	DBPassword  string `json:"db_password"`
	SSLMode     string `json:"ssl_mode"`
	SSLCert     string `json:"ssl_cert"`
	SSLKey      string `json:"ssl_key"`
	SSLRootCert string `json:"ssl_root_cert"`
}

type DerivedFields

type DerivedFields struct {
	ClusterNodes     []map[string]any
	Schema           string
	Table            string
	Key              []string
	Cols             []string
	ConnParams       []string
	Database         Database
	NodeList         []string
	HostMap          map[string]string
	TableList        []string
	ColTypes         map[string]map[string]string
	SimplePrimaryKey bool
	PKeyTypes        map[string]string
}

type DiffByNodePair

type DiffByNodePair struct {
	Rows map[string][]OrderedMap `json:"rows"` // Keyed by actual node name e.g. "n1", "n2"
}

DiffByNodePair holds the differing rows for a pair of nodes. The keys in the DiffOutput.Diffs map will be "nodeX/nodeY", and the Node1/Node2 fields here will store rows corresponding to nodeX and nodeY respectively.

type DiffOutput

type DiffOutput struct {
	NodeDiffs map[string]DiffByNodePair `json:"diffs"` // Key: "nodeA/nodeB" (sorted names)
	Summary   DiffSummary               `json:"summary"`
}

DiffOutput holds the structured diff data.

type DiffSummary

type DiffSummary struct {
	Schema                string         `json:"schema"`
	Table                 string         `json:"table"`
	TableFilter           string         `json:"table_filter,omitempty"`
	Nodes                 []string       `json:"nodes"`
	BlockSize             int            `json:"block_size"`
	CompareUnitSize       int            `json:"compare_unit_size"`
	ConcurrencyFactor     int            `json:"concurrency_factor"`
	MaxDiffRows           int64          `json:"max_diff_rows"`
	StartTime             string         `json:"start_time"`
	EndTime               string         `json:"end_time"`
	TimeTaken             string         `json:"time_taken"`
	DiffRowsCount         map[string]int `json:"diff_rows_count"` // Key: "nodeA/nodeB", Value: count of differing rows
	DiffRowLimitReached   bool           `json:"diff_row_limit_reached"`
	TotalRowsChecked      int64          `json:"total_rows_checked"` // Estimated
	InitialRangesCount    int            `json:"initial_ranges_count"`
	MismatchedRangesCount int            `json:"mismatched_ranges_count"`
	PrimaryKey            []string       `json:"primary_key"`
	EffectiveFilter       string         `json:"effective_filter,omitempty"`
	AgainstOrigin         string         `json:"against_origin,omitempty"`
	AgainstOriginResolved string         `json:"against_origin_resolved,omitempty"`
	Until                 string         `json:"until,omitempty"`
	OriginOnly            bool           `json:"origin_only,omitempty"`
}

DiffSummary provides metadata about the diff operation.

type KVPair

type KVPair struct {
	Key   string
	Value any
}

type LeafRange

type LeafRange struct {
	RangeStart []any `db:"range_start"`
	RangeEnd   []any `db:"range_end"`
}

LeafRange represents the start and end of a leaf's range.

type MtreeMetadata

type MtreeMetadata struct {
	SchemaName  string    `db:"schema_name"`
	TableName   string    `db:"table_name"`
	TotalRows   int64     `db:"total_rows"`
	BlockSize   int       `db:"block_size"`
	NumBlocks   int       `db:"num_blocks"`
	IsComposite bool      `db:"is_composite"`
	LastUpdated time.Time `db:"last_updated"`
}

MtreeMetadata represents a row in the ace_mtree_metadata table.

type NodeChild

type NodeChild struct {
	NodeLevel    int    `db:"node_level"`
	NodePosition int64  `db:"node_position"`
	NodeHash     []byte `db:"node_hash"`
}

NodeChild represents a child of a node in the Merkle tree.

type NodeGroup

type NodeGroup struct {
	SSH struct {
		OSUser     string `json:"os_user"`
		PrivateKey string `json:"private_key"`
	} `json:"ssh"`
	Name      string `json:"name"`
	IsActive  string `json:"is_active"`
	PublicIP  string `json:"public_ip"`
	PrivateIP string `json:"private_ip"`
	Port      string `json:"port"`
	Path      string `json:"path"`
}

type NodePairDiff

type NodePairDiff struct {
	Node1OnlyRows []map[string]any
	Node2OnlyRows []map[string]any
	ModifiedRows  []struct {
		Pkey      string
		Node1Data map[string]any
		Node2Data map[string]any
	}
}

NodePairDiff is a more detailed breakdown of differences for a single pair, often used internally during comparison.

type OrderedMap

type OrderedMap []KVPair

func (OrderedMap) Get

func (om OrderedMap) Get(key string) (any, bool)

func (OrderedMap) MarshalJSON

func (om OrderedMap) MarshalJSON() ([]byte, error)

func (*OrderedMap) UnmarshalJSON

func (om *OrderedMap) UnmarshalJSON(data []byte) error

type PkeyColumnType

type PkeyColumnType struct {
	ColumnName string
	DataType   string
}

PkeyColumnType holds the name and data type of a primary key column. Note: The query for this does not have aliases, so scanning relies on column order.

type PkeyOffset

type PkeyOffset struct {
	RangeStart []any
	RangeEnd   []any
}

PkeyOffset represents a range of primary key values.

type RepSetInfo

type RepSetInfo struct {
	SetName string   `json:"set_name"`
	Tables  []string `json:"tables"`
}

RepSetInfo holds information about a replication set.

type ReplicationSetDiff

type ReplicationSetDiff struct {
	TablePlacementDiffs []TableRepSetDiff `json:"table_placement_differences"`
}

ReplicationSetDiff highlights differences in replication sets.

type ReplicationSetPair

type ReplicationSetPair struct {
	Name  string     `json:"name"`
	Node1 RepSetInfo `json:"node1"`
	Node2 RepSetInfo `json:"node2"`
}

ReplicationSetPair shows a replication set that exists on both nodes but has different tables.

type RootNode

type RootNode struct {
	NodePosition int64  `db:"node_position"`
	NodeHash     []byte `db:"node_hash"`
}

RootNode represents the root of the Merkle tree.

type SpockConfig

type SpockConfig struct {
	SpockVersion string `json:"spock_version"`
	AutoDDL      string `json:"auto_ddl"`
}

type SpockDiffDetail

type SpockDiffDetail struct {
	Subscriptions   SubscriptionDiff   `json:"subscriptions"`
	ReplicationSets ReplicationSetDiff `json:"replication_sets"`
}

SpockDiffDetail holds the detailed differences between two nodes' spock configurations.

type SpockDiffOutput

type SpockDiffOutput struct {
	SpockConfigs map[string]any           `json:"spock_config"`
	Diffs        map[string]SpockPairDiff `json:"diffs"`
}

SpockDiffOutput represents the result of a spock-diff operation.

type SpockNodeAndSubInfo

type SpockNodeAndSubInfo struct {
	NodeID             int64    `db:"node_id"`
	NodeName           string   `db:"node_name"`
	Location           string   `db:"location"`
	Country            string   `db:"country"`
	SubID              int64    `db:"sub_id"`
	SubName            string   `db:"sub_name"`
	SubEnabled         bool     `db:"sub_enabled"`
	SubReplicationSets []string `db:"sub_replication_sets"`
}

SpockNodeAndSubInfo contains information about a spock node and its subscription.

type SpockPairDiff

type SpockPairDiff struct {
	Mismatch bool            `json:"mismatch"`
	Message  string          `json:"message"`
	Details  SpockDiffDetail `json:"details,omitempty"`
}

SpockPairDiff represents the diff result for a pair of nodes.

type SpockRepSetInfo

type SpockRepSetInfo struct {
	SetName string   `db:"set_name"`
	RelName []string `db:"relname"`
}

SpockRepSetInfo contains information about a replication set.

type SpockSubscription

type SpockSubscription struct {
	SubName         string   `json:"sub_name"`
	SubEnabled      bool     `json:"sub_enabled"`
	ReplicationSets []string `json:"replication_sets"`
}

SpockSubscription holds information about a spock subscription.

type SubscriptionDiff

type SubscriptionDiff struct {
	MissingOnNode1 []string           `json:"missing_on_node1"`
	MissingOnNode2 []string           `json:"missing_on_node2"`
	Different      []SubscriptionPair `json:"different"`
}

SubscriptionDiff highlights differences in subscriptions between two nodes.

type SubscriptionPair

type SubscriptionPair struct {
	Name  string            `json:"name"`
	Node1 SpockSubscription `json:"node1"`
	Node2 SpockSubscription `json:"node2"`
}

SubscriptionPair shows a subscription that exists on both nodes but has different properties.

type TableRepSetDiff

type TableRepSetDiff struct {
	TableName   string `json:"table_name"`
	Node1RepSet string `json:"node1_repset"`
	Node2RepSet string `json:"node2_repset"`
}

TableRepSetDiff details which replication set a table belongs to on each node if they differ.

type Task

type Task struct {
	ClusterName string
	TaskID      string
	TaskType    string
	TaskStatus  string
	TaskContext string
	StartedAt   time.Time
	FinishedAt  time.Time
	TimeTaken   float64
}

type UserPrivileges

type UserPrivileges struct {
	TableSelect            bool `db:"table_select"`
	TableCreate            bool `db:"table_create"`
	TableInsert            bool `db:"table_insert"`
	TableUpdate            bool `db:"table_update"`
	TableDelete            bool `db:"table_delete"`
	ColumnsSelect          bool `db:"columns_select"`
	TableConstraintsSelect bool `db:"table_constraints_select"`
	KeyColumnUsageSelect   bool `db:"key_column_usage_select"`
}

UserPrivileges describes the privileges a user has.

Jump to

Keyboard shortcuts

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