interpolation

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2020 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 ComputeFnData

type ComputeFnData struct {
	Name         string
	ArgumentType string
	ReturnType   string
}

ComputeFnData represents interpolation result for table's compute function

type ComputedFieldData

type ComputedFieldData struct {
	*schema.ComputedField
	GoType string
}

ComputedFieldData represents interpolation result for table's compute field

type FieldData

type FieldData struct {
	*schema.Field
	GoType string
}

FieldData represents interpolation result for table's field

type Interpolator

type Interpolator struct {
	Generator  string
	ImportPath string
	TablesData []*TableData
	ViewsData  []*ViewData
	HasExport  bool

	CreateDepsAll []dependencyData
	DropDepsAll   []dependencyData
	// contains filtered or unexported fields
}

Interpolator represents interpolator struct

func NewInterpolator

func NewInterpolator(baseImportPath, rootDir, defaultSchema string, ts []*schema.Table, vs []*schema.View) (*Interpolator, error)

NewInterpolator returns a new interpolator

func (Interpolator) DisplayTargets

func (ip Interpolator) DisplayTargets()

DisplayTargets displays targets info to stdout

func (*Interpolator) Interpolate

func (ip *Interpolator) Interpolate() error

Interpolate do interpolation based on specification files provided

type TableData

type TableData struct {
	*common.Names

	Generator string
	SpecFile  string

	DataSource     string
	CSVSeparator   string
	ComputePackage string
	ComputePkgVar  string

	Fields         []*FieldData
	ComputedFields []*ComputedFieldData
	ComputeFns     []*ComputeFnData
	Constraints    []string

	RequireSQLPkg     bool
	RequireStrconvPkg bool
	RequireTimePkg    bool
	HasValidation     bool
	HasComputed       bool

	DependsOn              []string
	CreateDeps             []dependencyData
	DropDeps               []dependencyData
	CreateDepsIncludeTable bool
	DropDepsIncludeTable   bool
	// contains filtered or unexported fields
}

TableData represents interpolation result for table

func (TableData) ImportPath

func (t TableData) ImportPath() string

ImportPath returns this table import path

func (TableData) PkgDir

func (t TableData) PkgDir() string

PkgDir returns this table package directory

func (TableData) PkgVar

func (t TableData) PkgVar() string

PkgVar returns this table package variable

type ViewData

type ViewData struct {
	*schema.View
	CreateDeps             []dependencyData
	DropDeps               []dependencyData
	CreateDepsIncludeTable bool
	DropDepsIncludeTable   bool
}

ViewData represents data for view

Jump to

Keyboard shortcuts

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