mongo

package
v3.3.6-202411291431 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Exporter

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

func New

func New(options *Options) (*Exporter, error)

New creates a new MongoDB exporter integration client based on options.

func (*Exporter) Close

func (exporter *Exporter) Close() error

func (*Exporter) Export

func (exporter *Exporter) Export(event *output.ResultEvent) error

Export writes a result document to the configured MongoDB collection in the database configured by the connection string

func (*Exporter) WriteRows

func (exporter *Exporter) WriteRows() error

WriteRows writes all rows from the rows list to the MongoDB collection and removes them from the list

type Options

type Options struct {
	// ConnectionString is the connection string to the MongoDB database
	ConnectionString string `yaml:"connection-string"`
	// CollectionName is the name of the MongoDB collection in which to store the results
	CollectionName string `yaml:"collection-name"`
	// OmitRaw excludes the Request and Response from the results (helps with filesize)
	OmitRaw bool `yaml:"omit-raw"`
	// BatchSize determines the number of results to be kept in memory before writing it to the database or 0 to
	//	persist all in memory and write all results at the end (default)
	BatchSize int `yaml:"batch-size"`
}

Options contains the configuration options for MongoDB exporter client

Jump to

Keyboard shortcuts

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