components-contrib/bindings
Mark Chmarny d2dcd8e508
Bi-directional output binding for PostgreSQL (#468)
* wip: postgres

* postgres crud binding

* CRUD postgres bidirectional output binding

* live test setup comments

* updated example conn string

* lint fixes

* test sql linting

* pr review updates

* lint fixes

* comment spelling

* metadata optional for close
2020-09-23 17:19:37 -07:00
..
alicloud/oss Add bi-directional bindings support (#350) 2020-05-26 23:32:20 -07:00
aws Add bi-directional bindings support (#350) 2020-05-26 23:32:20 -07:00
azure Add get operation for azure blob storage binding (#473) 2020-09-23 15:00:34 -07:00
cron renames the cron package (#395) 2020-07-16 18:18:34 -07:00
gcp Add bi-directional bindings support (#350) 2020-05-26 23:32:20 -07:00
http Add bi-directional bindings support (#350) 2020-05-26 23:32:20 -07:00
influx Influx binding (#401) 2020-08-17 12:45:58 -07:00
kafka Add bi-directional bindings support (#350) 2020-05-26 23:32:20 -07:00
kubernetes Change Kubernetes client to official go-client in the events binding. (#436) 2020-08-18 11:49:06 -07:00
mqtt Add bi-directional bindings support (#350) 2020-05-26 23:32:20 -07:00
postgres Bi-directional output binding for PostgreSQL (#468) 2020-09-23 17:19:37 -07:00
rabbitmq make rabbitMQ input binding could configure the Qos of Consumer. (#457) 2020-09-08 13:15:11 -07:00
redis Add bi-directional bindings support (#350) 2020-05-26 23:32:20 -07:00
twilio Add bi-directional bindings support (#350) 2020-05-26 23:32:20 -07:00
twitter Upgrade Go to 1.15 (#432) 2020-08-12 10:22:48 -07:00
Readme.md Update common operations list docs (#428) 2020-08-10 12:24:01 -07:00
input_binding.go Adding license header and updating to MIT license. (#26) 2019-10-09 10:58:08 -07:00
metadata.go Adding license header and updating to MIT license. (#26) 2019-10-09 10:58:08 -07:00
output_binding.go Add bi-directional bindings support (#350) 2020-05-26 23:32:20 -07:00
requests.go Add bi-directional bindings support (#350) 2020-05-26 23:32:20 -07:00
responses.go Add bi-directional bindings support (#350) 2020-05-26 23:32:20 -07:00
utils.go Add message time to live in RabbitMQ, Azure Service Bus/Storage Queue bindings (#298) 2020-04-15 10:07:16 -07:00

Readme.md

Bindings

Bindings provide a common way to trigger an application with events from external systems, or invoke an external system with optional data payloads. Bindings are great for event-driven, on-demand compute and help reduce boilerplate code.

To get started with bindings visit the How To Guide.

To view all the currently supported bindings visit: Dapr bindings.

For detailed binding specs visit Dapr binding specs.

Implementing a new binding

A compliant binding needs to implement one or more interfaces, depending on the type of binding (Input or Output):

Input binding:

type InputBinding interface {
	Init(metadata Metadata) error
	Read(handler func(*ReadResponse) error) error
}

Output binding:

An output binding can be used to invoke an external system and also to return data from it. Each output binding can decide which operations it supports. This information is communicated to the caller via the Operations() method.

type OutputBinding interface {
	Init(metadata Metadata) error
	Invoke(req *InvokeRequest) (*InvokeResponse, error)
	Operations() []OperationKind
}

When creating an Output Binding, a list of OperationKind items needs to be returned. For example, if running a component that takes in a SQL query and returns a result set, the OperationKind can be query.

While components are not restricted to a list of supported operations, it's best to use common ones if the operation kind falls under that operation definition. The list of common operations can be found here.

After implementing a binding, the specification docs need to be updated via a PR: Dapr docs.