mongodb

package
v4.4.1 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2022 License: MIT Imports: 30 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

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

mongodb input component allowed operations

Variables

This section is empty.

Functions

func NewOutput

NewOutput creates a new MongoDB output type.

func NewProcessor

func NewProcessor(conf processor.Config, mgr bundle.NewManagement) (processor.V2Batched, error)

NewProcessor returns a MongoDB processor.

Types

type Processor

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

Processor stores or retrieves data from a mongo db for each message of a batch

func (*Processor) Close

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

Close shuts down the processor and stops processing requests.

func (*Processor) ProcessBatch

func (m *Processor) ProcessBatch(ctx context.Context, spans []*tracing.Span, batch *message.Batch) ([]*message.Batch, error)

ProcessBatch applies the processor to a message batch, either creating >0 resulting messages or a response to be sent back to the message source.

type Writer

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

Writer is a benthos writer.Type implementation that writes messages to an Writer database.

func NewWriter

func NewWriter(
	mgr bundle.NewManagement,
	conf output.MongoDBConfig,
	log log.Modular,
	stats metrics.Type,
) (*Writer, error)

NewWriter creates a new MongoDB writer.Type.

func (*Writer) CloseAsync

func (m *Writer) CloseAsync()

CloseAsync begins cleaning up resources used by this writer asynchronously.

func (*Writer) ConnectWithContext

func (m *Writer) ConnectWithContext(ctx context.Context) error

ConnectWithContext attempts to establish a connection to the target mongo DB

func (*Writer) WaitForClose

func (m *Writer) WaitForClose(timeout time.Duration) error

WaitForClose will block until either the writer is closed or a specified timeout occurs.

func (*Writer) WriteWithContext

func (m *Writer) WriteWithContext(ctx context.Context, msg *message.Batch) error

WriteWithContext attempts to perform the designated operation to the mongo DB collection.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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