mongodbtarget

package
v1.24.2 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package mongodbtarget implements an adapter that connects to a MongoDB database and allows a user to insert, query, and update documents via cloudevents.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnvAccessorCtor

func EnvAccessorCtor() pkgadapter.EnvConfigAccessor

EnvAccessorCtor for configuration parameters

func NewTarget

NewTarget returns the adapter implementation.

Types

type InsertPayload

type InsertPayload struct {
	Database   string          `json:"database"`
	Collection string          `json:"collection"`
	Key        string          `json:"key"`
	Document   json.RawMessage `json:"document"`
}

InsertPayload defines the expected data structure found at the "io.triggermesh.mongodb.insert" payload.

type QueryPayload

type QueryPayload struct {
	Database   string `json:"database"`
	Collection string `json:"collection"`
	Key        string `json:"key"`
	Value      string `json:"value"`
}

QueryPayload defines the expected data found at the "io.triggermesh.mongodb.query" payload.

type QueryResponse

type QueryResponse struct {
	Collection map[string]string `json:"collection"`
}

QueryResponse defines the expected data structure received from a query to MongoDB.

type UpdatePayload

type UpdatePayload struct {
	Database    string `json:"database"`
	Collection  string `json:"collection"`
	SearchKey   string `json:"searchKey"`
	SearchValue string `json:"searchValue"`
	UpdateKey   string `json:"updateKey"`
	UpdateValue string `json:"updateValue"`
}

UpdatePayload defines the expected data found at the "io.triggermesh.mongodb.update" payload.

Jump to

Keyboard shortcuts

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