stcreator

package
v2.0.0-rc9 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LoaderFactories = map[string]func() LoaderParams{
	new(MongoLoader).Name(): func() LoaderParams {
		return new(MongoLoader)
	},
	new(PostgresLoader).Name(): func() LoaderParams {
		return new(PostgresLoader)
	},
}

Functions

This section is empty.

Types

type Config

type Config struct {
	Commands []string `yaml:"commands"`
	Loaders  Loaders  `yaml:"loaders"`
}

type Data

type Data struct {
	Structure []Node `yaml:"structure"`
}

type Entity

type Entity struct {
	Name string
}

type FormatError

type FormatError struct {
	Err  error
	Data []byte
}

func (FormatError) Error

func (e FormatError) Error() string

type Import

type Import struct {
	Resource string `yaml:"resource"`
}

type Imports

type Imports []StructImport

func (Imports) At

func (i Imports) At(p StructParam) string

type LoaderParams

type LoaderParams interface {
	Name() string
	Process() ([]StructMetadata, error)
}

type Loaders

type Loaders []LoaderParams

func (*Loaders) MarshalYAML

func (l *Loaders) MarshalYAML() (interface{}, error)

func (*Loaders) UnmarshalYAML

func (l *Loaders) UnmarshalYAML(node *yaml.Node) error

type MapType

type MapType struct {
	Type, NullType string
	DBTypes        []string
}

type MapTypes

type MapTypes []MapType

func (MapTypes) At

func (m MapTypes) At(t string) (MapType, bool)

type MongoLoader

type MongoLoader struct {
	Host string `yaml:"host"`
}

func (*MongoLoader) Name

func (*MongoLoader) Name() string

func (*MongoLoader) Process

func (*MongoLoader) Process() (result []StructMetadata, err error)

type Node

type Node struct {
	Name     string                 `yaml:"name"`
	Template string                 `yaml:"template"`
	Data     map[string]interface{} `yaml:"data"`
	Children []Node                 `yaml:"children"`
}

type PostgresLoader

type PostgresLoader struct {
	URL    string   `yaml:"url"`
	Tables []string `yaml:"tables"`
}

func (*PostgresLoader) Name

func (*PostgresLoader) Name() string

func (*PostgresLoader) Process

func (l *PostgresLoader) Process() (result []StructMetadata, err error)

type Project

type Project struct {
	Structs []StructMetadata
}

type ProjectLoader

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

func NewProjectLoader

func NewProjectLoader(projectName, projectID, pkgName, wd string) *ProjectLoader

func (*ProjectLoader) Process

func (l *ProjectLoader) Process(dir, configFilepath string) (*Project, error)

type StructImport

type StructImport struct {
	Pkg   string
	Param StructParam
}

type StructMetadata

type StructMetadata struct {
	Name, LowerName string
	Primary         StructParam
	Params          []StructParam
	Imports         Imports
}

type StructParam

type StructParam struct {
	Name, LowerName, ColumnName string
	Type, RawType               string
	Primary                     bool
	NotNull                     bool
	Default                     string
}

Jump to

Keyboard shortcuts

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