destination

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// KeySheetName is the name of the sheet needed to fetch data.
	KeySheetName = "sheetName"

	// KeyValueInputOption is the config name for how the input data
	// should be inserted.
	KeyValueInputOption = "valueInputOption"

	// KeyMaxRetries is the config key for max retry
	KeyMaxRetries = "maxRetries"
)

Variables

This section is empty.

Functions

func NewDestination

func NewDestination() sdk.Destination

Types

type Config

type Config struct {
	config.Config
	SheetName string
	// How the data is to be interpreted by the Google sheets
	// In case of USER_ENTERED, the data is inserted similar to data insertion from browser
	// In RAW, the data is inserted without any parsing
	ValueInputOption string
	MaxRetries       uint64
}

Config represents destination configuration with Google-Sheet configurations

func Parse

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

Parse attempts to parse the configurations into a Config struct that Destination could utilize

type Destination

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

Destination connector

func (*Destination) Configure

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

Configure parses and initializes the config.

func (*Destination) Open

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

Open makes sure everything is prepared to receive records.

func (*Destination) Parameters

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

Parameters returns a map of named sdk.Parameters that describe how to configure the Destination.

func (*Destination) Teardown

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

Teardown writes all the pending records to sheets and gracefully disconnects the client

func (*Destination) Write

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

Write writes a record into a Destination.

Jump to

Keyboard shortcuts

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