Documentation ¶
Index ¶
- func NewCache(conf cache.Config, mgr types.Manager, log log.Modular, stats metrics.Type) (types.Cache, error)
- func NewOutput(conf output.MongoDBConfig, mgr bundle.NewManagement, log log.Modular, ...) (output.Type, error)
- func NewProcessor(conf processor.Config, mgr bundle.NewManagement, log log.Modular, ...) (types.Processor, error)
- type Cache
- func (m *Cache) Add(key string, value []byte) error
- func (m *Cache) CloseAsync()
- func (m *Cache) Delete(key string) error
- func (m *Cache) Get(key string) ([]byte, error)
- func (m *Cache) Set(key string, value []byte) error
- func (m *Cache) SetMulti(items map[string][]byte) error
- func (m *Cache) WaitForClose(timeout time.Duration) error
- type Processor
- type Writer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCache ¶
func NewCache( conf cache.Config, mgr types.Manager, log log.Modular, stats metrics.Type, ) (types.Cache, error)
NewCache returns a MongoDB cache.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache is a cache that connects to mongo databases.
func (*Cache) Add ¶
Add attempts to set the value of a key only if the key does not already exist and returns an error if the key already exists or if the operation fails.
func (*Cache) Get ¶
Get attempts to locate and return a cached value by its key, returns an error if the key does not exist or if the operation failed.
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) CloseAsync ¶
func (m *Processor) CloseAsync()
CloseAsync shuts down the processor and stops processing requests.
func (*Processor) ProcessMessage ¶
ProcessMessage applies the processor to a message, 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 ¶
ConnectWithContext attempts to establish a connection to the target mongo DB
func (*Writer) WaitForClose ¶
WaitForClose will block until either the writer is closed or a specified timeout occurs.