config

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

Documentation

Index

Constants

View Source
const (
	KeyConnection string = "connection"
	KeyTable      string = "table"
	KeyColumns    string = "columns"
	KeyPrimaryKey string = "primaryKey"
	KeyBatchSize  string = "batchSize"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Connection string connection to snowflake DB.
	// Detail information https://pkg.go.dev/github.com/snowflakedb/gosnowflake@v1.6.9#hdr-Connection_String
	Connection string `validate:"required"`

	// Table name.
	Table string `validate:"required,max=255"`

	// List of columns from table, by default read all columns.
	Columns []string

	// Key - Column name that records should use for their `Key` fields.
	Key string `validate:"required,max=251"`

	// BatchSize - size of batch.
	BatchSize int `validate:"gte=1,lte=100000"`
}

Config represents configuration needed for Snowflake.

func Parse

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

Parse attempts to parse plugins.Config into a Config struct.

func (Config) Validate

func (c Config) Validate() error

Validate validates the Config.

Jump to

Keyboard shortcuts

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