config

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultOutput = OutputJSONRaw

DefaultOutput represents the default output

Functions

func MustReadCfgFile

func MustReadCfgFile()

MustReadCfgFile reads the config file stated with or without given config file location

Types

type Config

type Config struct {
	Copy []*DynamoDBCopyConfig `mapstructure:"copy"`
	Dump []*DynamoDBDumpConfig `mapstructure:"dump"`
}

Config represents a global configuration

func BindCopyConfigByKey

func BindCopyConfigByKey(key string) (*Config, error)

BindCopyConfigByKey binds the read configurations to Copy Config struct

func BindDumpConfigByKey added in v1.0.4

func BindDumpConfigByKey(key string) (*Config, error)

BindDumpConfigByKey binds the read configurations to Dump Config struct

func MustBind

func MustBind() *Config

MustBind binds the read configurations to Config struct

type DynamoDBConfig

type DynamoDBConfig struct {
	Region    string `mapstructure:"region"`
	TableName string `mapstructure:"table"`
	// Required for DynamoDB local
	Endpoint        string `mapstructure:"endpoint"`
	AccessKeyID     string `mapstructure:"accessKeyID"`
	SecretAccessKey string `mapstructure:"secretAccessKey"`
}

DynamoDBConfig represents connection info for a specific table

type DynamoDBCopyConfig added in v1.0.3

type DynamoDBCopyConfig struct {
	Service string          `mapstructure:"service"`
	Origin  *DynamoDBConfig `mapstructure:"origin"`
	Target  *DynamoDBConfig `mapstructure:"target"`
}

DynamoDBCopyConfig maps origin and target configs for DynamoDB

type DynamoDBDumpConfig added in v1.0.3

type DynamoDBDumpConfig struct {
	DynamoDB DynamoDBConfig `mapstructure:"db"`
	Service  string         `mapstructure:"service"`
	FileName string         `mapstructure:"filename"`
	Output   Output         `mapstructure:"output"`
}

DynamoDBDumpConfig maps dump configs for DynamoDB

type Output added in v1.0.3

type Output string

Output represents a file extension

const (
	OutputJSON    Output = "json"
	OutputJSONRaw Output = "jsonRaw"
)

Output constants

func (Output) DumpDelimiter added in v1.0.3

func (o Output) DumpDelimiter() []byte

DumpDelimiter returns a delimiter string for dump

func (Output) DumpPrefix added in v1.0.3

func (o Output) DumpPrefix() []byte

DumpPrefix returns a prefix string for dump

func (Output) DumpSuffix added in v1.0.3

func (o Output) DumpSuffix() []byte

DumpSuffix returns a suffix string for dump

Jump to

Keyboard shortcuts

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