context

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2023 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Grant

type Grant string
const (
	Select     Grant = "select"
	Insert     Grant = "insert"
	Update     Grant = "update"
	Delete     Grant = "delete"
	Truncate   Grant = "truncate"
	References Grant = "references"
	Trigger    Grant = "trigger"
)

type Notificator

type Notificator interface {
	NotifyBaseReplicationEventHandler(fn func(handler eventhandlers.BaseReplicationEventHandler) error)
	NotifySystemCatalogReplicationEventHandler(fn func(handler eventhandlers.SystemCatalogReplicationEventHandler) error)
	NotifyCompressionReplicationEventHandler(fn func(handler eventhandlers.CompressionReplicationEventHandler) error)
	NotifyHypertableReplicationEventHandler(fn func(handler eventhandlers.HypertableReplicationEventHandler) error)
	NotifyLogicalReplicationEventHandler(fn func(handler eventhandlers.LogicalReplicationEventHandler) error)
	NotifySnapshottingEventHandler(fn func(handler eventhandlers.SnapshottingEventHandler) error)
}

type ReplicationConnection

type ReplicationConnection struct {
	// contains filtered or unexported fields
}

func (*ReplicationConnection) Close

func (rc *ReplicationConnection) Close() error

func (*ReplicationConnection) CreateReplicationSlot

func (rc *ReplicationConnection) CreateReplicationSlot() (slotName, snapshotName string, created bool, err error)

func (*ReplicationConnection) DropReplicationSlot

func (rc *ReplicationConnection) DropReplicationSlot() error

func (*ReplicationConnection) ReceiveMessage

func (rc *ReplicationConnection) ReceiveMessage(deadline time.Time) (pgproto3.BackendMessage, error)

func (*ReplicationConnection) SendStatusUpdate

func (rc *ReplicationConnection) SendStatusUpdate() error

func (*ReplicationConnection) StartReplication

func (rc *ReplicationConnection) StartReplication(pluginArguments []string) error

func (*ReplicationConnection) StopReplication

func (rc *ReplicationConnection) StopReplication() error

type ReplicationContext

type ReplicationContext struct {
	// contains filtered or unexported fields
}

func NewReplicationContext

func NewReplicationContext(config *spiconfig.Config, pgxConfig *pgx.ConnConfig,
	namingStrategy namingstrategy.NamingStrategy, stateStorage statestorage.Storage) (*ReplicationContext, error)

func (*ReplicationContext) AcknowledgeProcessed

func (rc *ReplicationContext) AcknowledgeProcessed(xld pgtypes.XLogData) error

func (*ReplicationContext) AcknowledgeReceived

func (rc *ReplicationContext) AcknowledgeReceived(xld pgtypes.XLogData)

func (*ReplicationContext) AttachTablesToPublication

func (rc *ReplicationContext) AttachTablesToPublication(entities ...systemcatalog.SystemEntity) error

func (*ReplicationContext) CreatePublication

func (rc *ReplicationContext) CreatePublication() (bool, error)

func (*ReplicationContext) DatabaseName

func (rc *ReplicationContext) DatabaseName() string

func (*ReplicationContext) DatabaseUsername

func (rc *ReplicationContext) DatabaseUsername() string

func (*ReplicationContext) DetachTablesFromPublication

func (rc *ReplicationContext) DetachTablesFromPublication(entities ...systemcatalog.SystemEntity) error

func (*ReplicationContext) DropPublication

func (rc *ReplicationContext) DropPublication() error

func (*ReplicationContext) EncodedState

func (rc *ReplicationContext) EncodedState(name string) (encodedState []byte, present bool)

func (*ReplicationContext) EnqueueTask

func (rc *ReplicationContext) EnqueueTask(task Task) error

func (*ReplicationContext) EnqueueTaskAndWait

func (rc *ReplicationContext) EnqueueTaskAndWait(task Task) error

func (*ReplicationContext) EventTopicName

func (rc *ReplicationContext) EventTopicName(hypertable *systemcatalog.Hypertable) string

func (*ReplicationContext) ExistsPublication

func (rc *ReplicationContext) ExistsPublication() (bool, error)

func (*ReplicationContext) ExistsTableInPublication

func (rc *ReplicationContext) ExistsTableInPublication(entity systemcatalog.SystemEntity) (found bool, err error)

func (*ReplicationContext) FetchHypertableSnapshotBatch

func (rc *ReplicationContext) FetchHypertableSnapshotBatch(hypertable *systemcatalog.Hypertable, snapshotName string,
	cb func(lsn pgtypes.LSN, values map[string]any) error) error

func (*ReplicationContext) GetSchema

func (rc *ReplicationContext) GetSchema(schemaName string) schema.Struct

func (*ReplicationContext) GetSchemaOrCreate

func (rc *ReplicationContext) GetSchemaOrCreate(schemaName string, creator func() schema.Struct) schema.Struct

func (*ReplicationContext) GetSnapshotContext

func (rc *ReplicationContext) GetSnapshotContext() (*watermark.SnapshotContext, error)

func (*ReplicationContext) HasTablePrivilege

func (rc *ReplicationContext) HasTablePrivilege(
	entity systemcatalog.SystemEntity, grant Grant) (access bool, err error)

func (*ReplicationContext) HypertableEnvelopeSchemaName

func (rc *ReplicationContext) HypertableEnvelopeSchemaName(hypertable *systemcatalog.Hypertable) string

func (*ReplicationContext) HypertableKeySchemaName

func (rc *ReplicationContext) HypertableKeySchemaName(hypertable *systemcatalog.Hypertable) string

func (*ReplicationContext) InitialSnapshotMode

func (rc *ReplicationContext) InitialSnapshotMode() spiconfig.InitialSnapshotMode

func (*ReplicationContext) IsLogicalReplicationEnabled

func (rc *ReplicationContext) IsLogicalReplicationEnabled() bool

func (*ReplicationContext) IsMinimumPostgresVersion

func (rc *ReplicationContext) IsMinimumPostgresVersion() bool

func (*ReplicationContext) IsMinimumTimescaleVersion

func (rc *ReplicationContext) IsMinimumTimescaleVersion() bool

func (*ReplicationContext) IsPG14GE

func (rc *ReplicationContext) IsPG14GE() bool

func (*ReplicationContext) IsTSDB212GE

func (rc *ReplicationContext) IsTSDB212GE() bool

func (*ReplicationContext) LastBeginLSN

func (rc *ReplicationContext) LastBeginLSN() pgtypes.LSN

func (*ReplicationContext) LastCommitLSN

func (rc *ReplicationContext) LastCommitLSN() pgtypes.LSN

func (*ReplicationContext) LastProcessedLSN

func (rc *ReplicationContext) LastProcessedLSN() pgtypes.LSN

func (*ReplicationContext) LastReceivedLSN

func (rc *ReplicationContext) LastReceivedLSN() pgtypes.LSN

func (*ReplicationContext) LastTransactionId

func (rc *ReplicationContext) LastTransactionId() uint32

func (*ReplicationContext) LoadChunks

func (rc *ReplicationContext) LoadChunks(cb func(chunk *systemcatalog.Chunk) error) error

func (*ReplicationContext) LoadHypertables

func (rc *ReplicationContext) LoadHypertables(cb func(hypertable *systemcatalog.Hypertable) error) error

func (*ReplicationContext) MessageEnvelopeSchemaName

func (rc *ReplicationContext) MessageEnvelopeSchemaName() string

func (*ReplicationContext) MessageTopicName

func (rc *ReplicationContext) MessageTopicName() string

func (*ReplicationContext) NewReplicationConnection

func (rc *ReplicationContext) NewReplicationConnection() (*ReplicationConnection, error)

func (*ReplicationContext) Offset

func (rc *ReplicationContext) Offset() (*statestorage.Offset, error)

func (*ReplicationContext) PostgresVersion

func (rc *ReplicationContext) PostgresVersion() version.PostgresVersion

func (*ReplicationContext) PublicationAutoDrop

func (rc *ReplicationContext) PublicationAutoDrop() bool

func (*ReplicationContext) PublicationCreate

func (rc *ReplicationContext) PublicationCreate() bool

func (*ReplicationContext) PublicationName

func (rc *ReplicationContext) PublicationName() string

func (*ReplicationContext) ReadContinuousAggregate

func (rc *ReplicationContext) ReadContinuousAggregate(
	materializedHypertableId int32) (viewSchema, viewName string, found bool, err error)

func (*ReplicationContext) ReadHypertableSchema

func (rc *ReplicationContext) ReadHypertableSchema(
	cb func(hypertable *systemcatalog.Hypertable, columns []systemcatalog.Column) bool,
	hypertables ...*systemcatalog.Hypertable) error

func (*ReplicationContext) ReadPublishedTables

func (rc *ReplicationContext) ReadPublishedTables() ([]systemcatalog.SystemEntity, error)

func (*ReplicationContext) ReadReplicaIdentity

func (rc *ReplicationContext) ReadReplicaIdentity(entity systemcatalog.SystemEntity) (pgtypes.ReplicaIdentity, error)

func (*ReplicationContext) ReadSnapshotHighWatermark

func (rc *ReplicationContext) ReadSnapshotHighWatermark(
	hypertable *systemcatalog.Hypertable, snapshotName string) (map[string]any, error)

func (*ReplicationContext) RegisterReplicationEventHandler

func (rc *ReplicationContext) RegisterReplicationEventHandler(handler eventhandlers.BaseReplicationEventHandler)

func (*ReplicationContext) RegisterSchema

func (rc *ReplicationContext) RegisterSchema(schemaName string, schema schema.Struct)

func (*ReplicationContext) ReplicationSlotAutoDrop

func (rc *ReplicationContext) ReplicationSlotAutoDrop() bool

func (*ReplicationContext) ReplicationSlotCreate

func (rc *ReplicationContext) ReplicationSlotCreate() bool

func (*ReplicationContext) ReplicationSlotName

func (rc *ReplicationContext) ReplicationSlotName() string

func (*ReplicationContext) RunTask

func (rc *ReplicationContext) RunTask(task Task) error

func (*ReplicationContext) SchemaTopicName

func (rc *ReplicationContext) SchemaTopicName(hypertable *systemcatalog.Hypertable) string

func (*ReplicationContext) SetEncodedState

func (rc *ReplicationContext) SetEncodedState(name string, encodedState []byte)

func (*ReplicationContext) SetLastBeginLSN

func (rc *ReplicationContext) SetLastBeginLSN(lsn pgtypes.LSN)

func (*ReplicationContext) SetLastCommitLSN

func (rc *ReplicationContext) SetLastCommitLSN(lsn pgtypes.LSN)

func (*ReplicationContext) SetLastTransactionId

func (rc *ReplicationContext) SetLastTransactionId(xid uint32)

func (*ReplicationContext) SetSnapshotContext

func (rc *ReplicationContext) SetSnapshotContext(snapshotContext *watermark.SnapshotContext) error

func (*ReplicationContext) SnapshotChunkTable

func (rc *ReplicationContext) SnapshotChunkTable(chunk *systemcatalog.Chunk,
	cb func(lsn pgtypes.LSN, values map[string]any) error) (pgtypes.LSN, error)

func (*ReplicationContext) SnapshotContextTransaction

func (rc *ReplicationContext) SnapshotContextTransaction(snapshotName string,
	createIfNotExists bool, transaction func(snapshotContext *watermark.SnapshotContext) error) error

func (*ReplicationContext) StartReplicationContext

func (rc *ReplicationContext) StartReplicationContext() error

func (*ReplicationContext) StateDecoder

func (rc *ReplicationContext) StateDecoder(name string, decoder encoding.BinaryUnmarshaler) (present bool, err error)

func (*ReplicationContext) StateEncoder

func (rc *ReplicationContext) StateEncoder(name string, encoder encoding.BinaryMarshaler) error

func (*ReplicationContext) StopReplicationContext

func (rc *ReplicationContext) StopReplicationContext() error

func (*ReplicationContext) SystemId

func (rc *ReplicationContext) SystemId() string

func (*ReplicationContext) Timeline

func (rc *ReplicationContext) Timeline() int32

func (*ReplicationContext) TimescaleVersion

func (rc *ReplicationContext) TimescaleVersion() version.TimescaleVersion

func (*ReplicationContext) TopicPrefix

func (rc *ReplicationContext) TopicPrefix() string

func (*ReplicationContext) WALLevel

func (rc *ReplicationContext) WALLevel() string

type Task

type Task = func(notificator Notificator)

Jump to

Keyboard shortcuts

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