source

package
v0.0.0-...-7b86a86 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// ConfigKeyOrderingKey is a config name for a orderingKey field.
	ConfigKeyOrderingKey = "orderingKey"
	// ConfigKeyKeys is the config name for a keys field.
	ConfigKeyKeys = "keys"
	// ConfigKeySnapshot is a config name for a snapshot field.
	ConfigKeySnapshot = "snapshot"
	// ConfigKeyMetaProperties is a config name for a metaProperties field.
	ConfigKeyMetaProperties = "metaProperties"
	// ConfigKeyBatchSize is a config name for a batchSize field.
	ConfigKeyBatchSize = "batchSize"
)
View Source
const (
	ConfigBatchSize      = "batchSize"
	ConfigContainer      = "container"
	ConfigDatabase       = "database"
	ConfigKeys           = "keys"
	ConfigMetaProperties = "metaProperties"
	ConfigOrderingKey    = "orderingKey"
	ConfigPartitionValue = "partitionValue"
	ConfigPrimaryKey     = "primaryKey"
	ConfigSnapshot       = "snapshot"
	ConfigUri            = "uri"
)

Variables

This section is empty.

Functions

func New

func New() sdk.Source

New creates a new instance of the Source.

Types

type Config

type Config struct {
	config.Config

	// The name of a key that is used for ordering items.
	OrderingKey string `json:"orderingKey" validate:"required"`
	// Comma-separated list of key names to build the opencdc.Record.Key.
	Keys []string `json:"keys"`
	// Determines whether the connector takes a snapshot
	// of all items before starting CDC mode.
	Snapshot bool `json:"snapshot" default:"true"`
	// MetaProperties whether the connector takes
	// the next automatically generated meta-properties:
	// "_rid", "_ts", "_self", "_etag", "_attachments".
	MetaProperties bool `json:"metaProperties" default:"false"`
	// The size of an element batch.
	BatchSize uint `json:"batchSize" validate:"gt=0,lt=100001" default:"1000"`
}

Config holds configurable values specific to source.

func (Config) Parameters

func (Config) Parameters() map[string]config.Parameter

type Iterator

type Iterator interface {
	HasNext(context.Context) (bool, error)
	Next() (opencdc.Record, error)
}

Iterator is an interface needed for the Source.

type Source

type Source struct {
	sdk.UnimplementedSource
	// contains filtered or unexported fields
}

Source is an Azure Cosmos DB for NoSQL source connector.

func (*Source) Ack

func (s *Source) Ack(ctx context.Context, sdkPosition opencdc.Position) error

Ack just logs the debug event with the position.

func (*Source) Configure

func (s *Source) Configure(ctx context.Context, raw config.Config) error

Configure parses and initializes the Source config.

func (*Source) Open

func (s *Source) Open(ctx context.Context, sdkPosition opencdc.Position) error

Open parses the position and initializes the iterator.

func (*Source) Parameters

func (s *Source) Parameters() config.Parameters

Parameters is a map of named [config.Parameter] that describe how to configure the Source.

func (*Source) Read

func (s *Source) Read(ctx context.Context) (opencdc.Record, error)

Read returns the next opencdc.Record.

func (*Source) Teardown

func (s *Source) Teardown(ctx context.Context) error

Teardown just logs the info event.

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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