events

package
v4.19.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Data modification events
	EventTypeItemUpdate = EventType(bindings.EventTypeItemUpdate)
	EventTypeItemUpsert = EventType(bindings.EventTypeItemUpsert)
	EventTypeItemDelete = EventType(bindings.EventTypeItemDelete)
	EventTypeItemInsert = EventType(bindings.EventTypeItemInsert)
	EventTypeTruncate   = EventType(bindings.EventTypeTruncate)
	EventTypePutMeta    = EventType(bindings.EventTypePutMeta)
	EventTypeDeleteMeta = EventType(bindings.EventTypeDeleteMeta)
	// Index modification events
	EventTypeIndexAdd    = EventType(bindings.EventTypeIndexAdd)
	EventTypeIndexDrop   = EventType(bindings.EventTypeIndexDrop)
	EventTypeIndexUpdate = EventType(bindings.EventTypeIndexUpdate)
	// Transaction events
	EventTypeBeginTx       = EventType(bindings.EventTypeBeginTx)
	EventTypeCommitTx      = EventType(bindings.EventTypeCommitTx)
	EventTypeItemUpdateTx  = EventType(bindings.EventTypeItemUpdateTx)
	EventTypeItemUpsertTx  = EventType(bindings.EventTypeItemUpsertTx)
	EventTypeItemDeleteTx  = EventType(bindings.EventTypeItemDeleteTx)
	EventTypeItemInsertTx  = EventType(bindings.EventTypeItemInsertTx)
	EventTypePutMetaTx     = EventType(bindings.EventTypePutMetaTx)
	EventTypeUpdateQuery   = EventType(bindings.EventTypeUpdateQuery)
	EventTypeDeleteQuery   = EventType(bindings.EventTypeDeleteQuery)
	EventTypeUpdateQueryTx = EventType(bindings.EventTypeUpdateQueryTx)
	EventTypeDeleteQueryTx = EventType(bindings.EventTypeDeleteQueryTx)
	// Schema setting
	EventTypeSetSchema = EventType(bindings.EventTypeSetSchema)
	// Namespace operation events
	EventTypeAddNamespace    = EventType(bindings.EventTypeAddNamespace)
	EventTypeDropNamespace   = EventType(bindings.EventTypeDropNamespace)
	EventTypeCloseNamespace  = EventType(bindings.EventTypeCloseNamespace)
	EventTypeRenameNamespace = EventType(bindings.EventTypeRenameNamespace)
	// Replication sync events
	EventTypeNamespaceSync             = EventType(bindings.EventTypeResyncNamespaceGeneric)
	EventTypeNamespaceSyncOnLeaderInit = EventType(bindings.EventTypeResyncNamespaceLeaderInit)
	// Updates queue overflow event
	EventTypeUpdatesDrop = EventType(bindings.EventTypeResyncOnUpdatesDrop)
	// Internal system events
	EventTypeNone                    = EventType(bindings.EventTypeNone)
	EventTypeEmptyUpdate             = EventType(bindings.EventTypeEmptyUpdate)
	EventTypeNodeNetworkCheck        = EventType(bindings.EventTypeNodeNetworkCheck)
	EventTypeSetTagsMatcher          = EventType(bindings.EventTypeSetTagsMatcher)
	EventTypeSetTagsMatcherTx        = EventType(bindings.EventTypeSetTagsMatcherTx)
	EventTypeSaveShardingConfig      = EventType(bindings.EventTypeSaveShardingConfig)
	EventTypeApplyShardingConfig     = EventType(bindings.EventTypeApplyShardingConfig)
	EventTypeResetOldShardingConfig  = EventType(bindings.EventTypeResetOldShardingConfig)
	EventTypeResetCandidateConfig    = EventType(bindings.EventTypeResetCandidateConfig)
	EventTypeRollbackCandidateConfig = EventType(bindings.EventTypeRollbackCandidateConfig)
)

Reindexer event types

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

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

func (*Event) Database

func (e *Event) Database() string

Database name from the source node

func (*Event) LSN

func (e *Event) LSN() LsnT

LSN - corresponding LSN in the namespace's WAL

func (*Event) Namespace

func (e *Event) Namespace() string

Namespace name

func (*Event) NamespaceVersion

func (e *Event) NamespaceVersion() LsnT

NamespaceVersion - source namespace version

func (*Event) ServerID

func (e *Event) ServerID() int

ServerID of the source node

func (*Event) ShardID

func (e *Event) ShardID() int

ShardID of the source node

func (*Event) Timestamp

func (e *Event) Timestamp() time.Time

Timestamp of the event's creation

func (*Event) Type

func (e *Event) Type() EventType

Type - event type

type EventSerializationOpts

type EventSerializationOpts struct {
	IsWithDBName    bool
	IsWithLSN       bool
	IsWithShardID   bool
	IsWithServerID  bool
	IsWithTimestamp bool
	IsWithData      bool
}

type EventType

type EventType int

type EventsHandler

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

func NewEventsHandler

func NewEventsHandler(owner bindings.RawBinding) *EventsHandler

func (*EventsHandler) CreateStream

func (eh *EventsHandler) CreateStream(ctx context.Context, opts *EventsStreamOptions) *EventsStream

func (*EventsHandler) OnError

func (eh *EventsHandler) OnError(e error) error

func (*EventsHandler) OnEvent

func (eh *EventsHandler) OnEvent(e bindings.RawBuffer) (ret error)

This method is executed in the single goroutine

type EventsStream

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

func (*EventsStream) Chan

func (es *EventsStream) Chan() chan *Event

Chan - returns events channel. It will be closed in case of errors, do not close it from the user's code

func (*EventsStream) Close

func (es *EventsStream) Close(ctx context.Context) error

Close must be called to finalize stream correctly

func (*EventsStream) Error

func (es *EventsStream) Error() error

Error - return current stream error

type EventsStreamOptions

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

func DefaultEventsStreamOptions

func DefaultEventsStreamOptions() *EventsStreamOptions

DefaultSubscriptionOptions return default subscription opts

func (*EventsStreamOptions) WithAllTransactionEvents

func (opts *EventsStreamOptions) WithAllTransactionEvents() *EventsStreamOptions

Enable full transactions events set (beginTx, all internal tx records and commit)

func (*EventsStreamOptions) WithAnyEvents

func (opts *EventsStreamOptions) WithAnyEvents() *EventsStreamOptions

Enable all possible events

func (*EventsStreamOptions) WithConfigNamespace

func (opts *EventsStreamOptions) WithConfigNamespace() *EventsStreamOptions

Enable events from #config-namespace

func (*EventsStreamOptions) WithDBName

func (opts *EventsStreamOptions) WithDBName() *EventsStreamOptions

If set, each event will contain source database name This option is for the future development, when cluster subscription will be implemented

func (*EventsStreamOptions) WithDocModifyEvents

func (opts *EventsStreamOptions) WithDocModifyEvents() *EventsStreamOptions

Enable documents modification events (except transaction records)

func (*EventsStreamOptions) WithEvents

func (opts *EventsStreamOptions) WithEvents(types ...EventType) *EventsStreamOptions

Add custom events set

func (*EventsStreamOptions) WithIndexModifyEvents

func (opts *EventsStreamOptions) WithIndexModifyEvents() *EventsStreamOptions

Enable index modification events

func (*EventsStreamOptions) WithLSN

func (opts *EventsStreamOptions) WithLSN() *EventsStreamOptions

If set, each event will contain record's LSN

func (*EventsStreamOptions) WithNamespaceOperationEvents

func (opts *EventsStreamOptions) WithNamespaceOperationEvents() *EventsStreamOptions

Enable namespaces modification events (add, drop, rename)

func (*EventsStreamOptions) WithNamespacesList

func (opts *EventsStreamOptions) WithNamespacesList(namespaces ...string) *EventsStreamOptions

Set target subscription namespaces to recieve events from

func (*EventsStreamOptions) WithServerID

func (opts *EventsStreamOptions) WithServerID() *EventsStreamOptions

If set, each event will contain server ID of the emmiter node

func (*EventsStreamOptions) WithShardID

func (opts *EventsStreamOptions) WithShardID() *EventsStreamOptions

If set, each event will contain shard ID of the emmiter node

func (*EventsStreamOptions) WithTimestamp

func (opts *EventsStreamOptions) WithTimestamp() *EventsStreamOptions

If set, each event will contain creation timestamp

func (*EventsStreamOptions) WithTransactionCommitEvents

func (opts *EventsStreamOptions) WithTransactionCommitEvents() *EventsStreamOptions

Enable transactions commit events

type LsnT

type LsnT bindings.LsnT

func (LsnT) IsEmpty

func (lsn LsnT) IsEmpty() bool

Jump to

Keyboard shortcuts

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