generator

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2021 License: MIT Imports: 8 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 {
	PackageName string                   `yaml:"packageName"`
	Processors  []ProcessorConfiguration `yaml:"processors"`
}

func ParseConfig

func ParseConfig(ctx context.Context, r io.Reader) (*Configuration, error)

func ParseConfigFile

func ParseConfigFile(ctx context.Context, fpath string) (*Configuration, error)

type FieldConfiguration

type FieldConfiguration struct {
	Name    string                    `yaml:"name"`
	Column  int64                     `yaml:"column"`
	Decoder FieldDecoderConfiguration `yaml:"decoder"`
}

type FieldDecoderConfiguration

type FieldDecoderConfiguration struct {
	Name    string   `yaml:"name"`
	Options []string `yaml:"options"`
}

type Generator

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

func New

func New(cfg *Configuration) *Generator

func (*Generator) Generate

func (g *Generator) Generate(ctx context.Context) ([]byte, error)

type ProcessorConfiguration

type ProcessorConfiguration struct {
	RecordType      string                        `yaml:"recordType"`
	Type            string                        `yaml:"type"`
	Fields          map[string]FieldConfiguration `yaml:"fields"`
	FieldsPerRecord *int                          `yaml:"fieldsPerRecord"`
	Encoding        string                        `yaml:"encoding"`
	Comma           string                        `yaml:"comma"`
}

Directories

Path Synopsis
testcode

Jump to

Keyboard shortcuts

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