destination

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: May 11, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ConfigKeyRetryWait is a config name for a retry wait duration.
	ConfigKeyRetryWait = "retryWait"
	// ConfigKeyRetryAttempts is a config name for a retry attempts count.
	ConfigKeyRetryAttempts = "retryAttempts"
)

Variables

This section is empty.

Functions

func NewDestination

func NewDestination() sdk.Destination

NewDestination creates new instance of the Destination.

Types

type Config

type Config struct {
	config.Config

	RetryWait     time.Duration `key:"retryWait"`
	RetryAttempts int           `key:"retryAttempts"`
}

Config holds destination specific configurable values.

func Parse

func Parse(cfg map[string]string) (Config, error)

Parse maps the incoming map to the Config and validates it.

type Destination

type Destination struct {
	sdk.UnimplementedDestination
	// contains filtered or unexported fields
}

Destination NATS Connector persists records to a NATS subject or stream.

func (*Destination) Configure

func (d *Destination) Configure(_ context.Context, cfg map[string]string) error

Configure parses and initializes the config.

func (*Destination) Open

func (d *Destination) Open(context.Context) error

Open makes sure everything is prepared to receive records.

func (*Destination) Parameters

func (d *Destination) Parameters() map[string]sdk.Parameter

func (*Destination) Teardown

func (d *Destination) Teardown(context.Context) error

Teardown gracefully closes connections.

func (*Destination) Write

func (d *Destination) Write(_ context.Context, records []sdk.Record) (int, error)

Write writes a record into a Destination.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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