config

package
v0.0.2-beta1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	S3SELECT_CONFIG_DIR        = "S3SELECT_CONFIG_DIR"
	S3SELECT_INPUT_FORMAT_CSV  = "csv"
	S3SELECT_INPUT_FORMAT_JSON = "json"
)

Variables

View Source
var ReadConfigFile = func(filename string) ([]byte, error) {
	f, err := os.Open(filename)
	if err != nil {
		return nil, err
	}
	defer f.Close()

	data, err := io.ReadAll(f)
	if err != nil {
		return nil, err
	}

	return data, nil
}

Functions

func ConfigDir

func ConfigDir() string

func ConfigFile

func ConfigFile() string

Types

type CSVInput

type CSVInput struct {
	AllowQuotedRecordDelimiter *bool   `yaml:"allowQuotedRecordDelimiter,omitempty"`
	Comments                   *string `yaml:"comments,omitempty"`
	FieldDelimiter             *string `yaml:"fieldDelimiter,omitempty"`
	FileHeaderInfo             *string `yaml:"fileHeaderInfo,omitempty"`
	QuoteCharacter             *string `yaml:"quoteCharacter,omitempty"`
	QuoteEscapeCharacter       *string `yaml:"quoteEscapeCharacter,omitempty"`
	RecordDelimiter            *string `yaml:"recordDelimiter,omitempty"`
}

type CSVOutput

type CSVOutput struct {
	FieldDelimiter       *string `yaml:"fieldDelimiter,omitempty"`
	QuoteCharacter       *string `yaml:"quoteCharacter,omitempty"`
	QuoteEscapeCharacter *string `yaml:"quoteEscapeCharacter,omitempty"`
	QuoteFields          *string `yaml:"quoteFields,omitempty"`
	RecordDelimiter      *string `yaml:"recordDelimiter,omitempty"`
}

type Config

type Config interface {
	GetAWSRegion() string
	SetAWSRegion(string)
	Profiles() (Profiles, error)
	SetProfile(string, Profile)
	Write(string) error
}

func ParseDefaultConfig

func ParseDefaultConfig() (Config, error)

type FileConfig

type FileConfig struct {
	AWSRegion string   `yaml:"awsRegion,omitempty"`
	Proflies  Profiles `yaml:"profiles,omitempty"`
}

func (*FileConfig) GetAWSRegion

func (c *FileConfig) GetAWSRegion() string

func (*FileConfig) Profiles

func (c *FileConfig) Profiles() (Profiles, error)

func (*FileConfig) SetAWSRegion

func (c *FileConfig) SetAWSRegion(region string)

func (*FileConfig) SetProfile

func (c *FileConfig) SetProfile(key string, newProfile Profile)

func (*FileConfig) Write

func (c *FileConfig) Write(filename string) error

type InputSerialization

type InputSerialization struct {
	FormatType      string        `yaml:"formatType,omitempty"`
	CSV             *CSVInput     `yaml:"csvInput,omitempty"`
	CompressionType *string       `yaml:"compressionType,omitempty"`
	JSON            *JSONInput    `yaml:"jsonInput,omitempty"`
	Parquet         *ParquetInput `yaml:"parquetInput,omitempty"`
}

type JSONInput

type JSONInput struct {
	Type *string `yaml:"type,omitempty"`
}

type JSONOutput

type JSONOutput struct {
	RecordDelimiter *string `yaml:"recordDelimiter,omitempty"`
}

type OutputSerialization

type OutputSerialization struct {
	FormatType string      `yaml:"formatType,omitempty"`
	CSV        *CSVOutput  `yaml:"csvInput,omitempty"`
	JSON       *JSONOutput `yaml:"jsonInput,omitempty"`
}

type ParquetInput

type ParquetInput struct{}

type Profile

type Profile struct {
	ExpressionType      string               `yaml:"expressionType,omitempty"`
	InputSerialization  *InputSerialization  `yaml:"inputSerialization,omitempty"`
	OutputSerialization *OutputSerialization `yaml:"outputSerialization,omitempty"`
}

func NewDefaultProfile

func NewDefaultProfile() Profile

func (*Profile) SetSerializations

func (p *Profile) SetSerializations(is *InputSerialization, os *OutputSerialization)

type Profiles

type Profiles = map[string]Profile

Jump to

Keyboard shortcuts

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