mongodb

package
v4.25.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FindInputOperation      = "find"
	AggregateInputOperation = "aggregate"
)

mongodb input component allowed operations.

Variables

This section is empty.

Functions

func ProcessorSpec added in v4.17.0

func ProcessorSpec() *service.ConfigSpec

ProcessorSpec defines the config spec of the mongodb processor.

Types

type JSONMarshalMode added in v4.17.0

type JSONMarshalMode string

JSONMarshalMode represents the way in which BSON should be marshalled to JSON.

const (
	// JSONMarshalModeCanonical Canonical BSON to JSON marshal mode.
	JSONMarshalModeCanonical JSONMarshalMode = "canonical"
	// JSONMarshalModeRelaxed Relaxed BSON to JSON marshal mode.
	JSONMarshalModeRelaxed JSONMarshalMode = "relaxed"
)

type Operation added in v4.17.0

type Operation string

Operation represents the operation that will be performed by MongoDB.

const (
	// OperationInsertOne Insert One operation.
	OperationInsertOne Operation = "insert-one"
	// OperationDeleteOne Delete One operation.
	OperationDeleteOne Operation = "delete-one"
	// OperationDeleteMany Delete many operation.
	OperationDeleteMany Operation = "delete-many"
	// OperationReplaceOne Replace one operation.
	OperationReplaceOne Operation = "replace-one"
	// OperationUpdateOne Update one operation.
	OperationUpdateOne Operation = "update-one"
	// OperationFindOne Find one operation.
	OperationFindOne Operation = "find-one"
	// OperationInvalid Invalid operation.
	OperationInvalid Operation = "invalid"
)

func NewOperation added in v4.17.0

func NewOperation(op string) Operation

NewOperation converts a string operation to a strongly-typed Operation.

type Processor

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

Processor encapsulates the logic of the mongodb processor.

func ProcessorFromParsed added in v4.17.0

func ProcessorFromParsed(conf *service.ParsedConfig, res *service.Resources) (mp *Processor, err error)

ProcessorFromParsed returns a mongodb processor from a parsed config.

func (*Processor) Close

func (m *Processor) Close(ctx context.Context) error

Close the connection to mongodb.

func (*Processor) ProcessBatch

func (m *Processor) ProcessBatch(ctx context.Context, batch service.MessageBatch) ([]service.MessageBatch, error)

ProcessBatch attempts to process a batch of messages.

Jump to

Keyboard shortcuts

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