csvtodynamo

package
v0.0.40 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	KeyToConverter map[string]keyConverter
	Columns        []string
}

Configuration for the Converter.

func NewConfiguration

func NewConfiguration() *Configuration

NewConfiguration creates the Configuration for the Converter.

func (*Configuration) AddBoolKeys

func (conf *Configuration) AddBoolKeys(s ...string) *Configuration

AddBoolKeys adds boolean keys to the configuration.

func (*Configuration) AddNumberKeys

func (conf *Configuration) AddNumberKeys(s ...string) *Configuration

AddNumberKeys adds numeric keys to the configuration.

func (*Configuration) AddStringKeys

func (conf *Configuration) AddStringKeys(s ...string) *Configuration

AddStringKeys add string keys to the configuration.

type Converter

type Converter struct {
	// contains filtered or unexported fields
}

Converter converts CSV to DynamoDB records.

func NewConverter

func NewConverter(r *csv.Reader, conf *Configuration) (*Converter, error)

NewConverter creates a new CSV to DynamoDB converter.

func (*Converter) Read

func (c *Converter) Read() (items map[string]*dynamodb.AttributeValue, err error)

Read a single item from the CSV.

func (*Converter) ReadBatch

func (c *Converter) ReadBatch() (items []map[string]*dynamodb.AttributeValue, read int, err error)

ReadBatch reads 25 items from the CSV. Only strings, numbers and boolean values are supported in CSV.

Jump to

Keyboard shortcuts

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