package
0.4.1
Repository: https://github.com/dapr/components-contrib.git
Documentation: pkg.go.dev

# README

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.

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Functions

TryGetTTL tries to get the ttl (in seconds) value for a binding.

# Constants

Non exhaustive list of operations.
Non exhaustive list of operations.
Non exhaustive list of operations.
Non exhaustive list of operations.
TTLMetadataKey defines the metadata key for setting a time to live (in seconds).

# Structs

AppResponse is the object describing the response from user code after a bindings event.
InvokeRequest is the object given to a dapr output binding.
InvokeResponse is the response object returned from an output binding.
Metadata represents a set of binding specific properties.
ReadResponse is an the return object from an dapr input binding.

# Interfaces

InputBinding is the interface to define a binding that triggers on incoming events.
OutputBinding is the interface for an output binding, allowing users to invoke remote systems with optional payloads.

# Type aliases

OperationKind defines an output binding operation.