source

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: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// KeyPollingPeriod is the config name for the google-sheets polling period
	KeyPollingPeriod        = "pollingPeriod"
	KeyDateTimeRenderOption = "dateTimeRenderOption"
	KeyValueRenderOption    = "valueRenderOption"
)

Variables

This section is empty.

Functions

func NewSource

func NewSource() sdk.Source

Types

type Config

type Config struct {
	config.Config
	PollingPeriod time.Duration

	// google sheets data fetch options.
	// Refer: https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets.values/batchGet#query-parameters
	DateTimeRenderOption string // values: SERIAL_NUMBER, FORMATTED_STRING // default: SERIAL_NUMBER
	ValueRenderOption    string // values: FORMATTED_VALUE, UNFORMATTED_VALUE, FORMULA// default: FORMATTED_VALUE
}

Config represents source configuration with Google-Sheets configurations

func Parse

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

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

type Iterator

type Iterator interface {
	HasNext() bool
	Next(ctx context.Context) (sdk.Record, error)
	Stop(ctx context.Context)
}

type Source

type Source struct {
	sdk.UnimplementedSource
	// contains filtered or unexported fields
}

Source connector

func (*Source) Ack

func (s *Source) Ack(ctx context.Context, tp sdk.Position) error

Ack is called by the conduit server after the record has been successfully processed by all destination connectors We do not need to send any ack to Google sheets as we poll the Sheets API for data, so there is no data to be ack'd

func (*Source) Configure

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

Configure validates the passed config and prepares the source connector

func (*Source) Open

func (s *Source) Open(ctx context.Context, rp sdk.Position) error

Open prepare the plugin to start sending records from the given position

func (*Source) Parameters

func (s *Source) Parameters() map[string]sdk.Parameter

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

func (*Source) Read

func (s *Source) Read(ctx context.Context) (sdk.Record, error)

Read gets the next object

func (*Source) Teardown

func (s *Source) Teardown(ctx context.Context) error

Teardown is called by the conduit server to stop the source connector all the cleanup should be done in this function

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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