domain

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Column added in v0.5.0

type Column struct {
	Name         string `json:"name"`
	Type         string `json:"type"`
	IsPrimaryKey bool   `json:"is_primary_key"`
	IsForeignKey bool   `json:"is_foreign_key"`
	IsExtraField bool   `json:"is_extra_field"`
}

Column describes the details of a column.

type ColumnAnswer added in v0.6.0

type ColumnAnswer struct {
	Name         string `survey:"column_name"`
	Type         string `survey:"column_type"`
	IsPrimaryKey bool   `survey:"is_primary_key"`
	IsForeignKey bool   `survey:"is_foreign_key"`
	AddMore      string `survey:"add_more"`
}

ColumnAnswer captures the answers for the column related questions.

type Diagram added in v0.5.0

type Diagram struct {
	Title         string
	TableList     []Table
	ReferenceList []Reference
}

Diagram describes the details of the database

type Options

type Options struct {
	CommonFields          cli.StringSlice
	Directory             string
	ExtraTablesDefinition string
	FileList              cli.StringSlice
	IDField               string
	OutputFilename        string
	OutputPath            string
	Tag                   string
	Title                 string
	ColumnNameCase        string
	TableNameCase         string
	TableNamePlural       bool

	// ExtraTablesSurvey guides the user through a wizard to provide more tables that
	// are not included in the respective files.
	ExtraTablesSurvey bool

	Config config.Config
}

Options describe the allowed options of the cli tool.

func NewOptions

func NewOptions(cfg config.Config) Options

NewOptions creates and returns a new options structure.

func (*Options) GetColumnNameCase

func (o *Options) GetColumnNameCase() *cli.StringFlag

GetColumnNameCase returns the definition for column_name_case flag.

func (*Options) GetCommonFields

func (o *Options) GetCommonFields() *cli.StringSliceFlag

GetCommonFields returns the definition for common_field flag.

func (*Options) GetDirectoryFlag

func (o *Options) GetDirectoryFlag() *cli.StringFlag

GetDirectoryFlag returns the definition for directory flag.

func (*Options) GetExtraTablesDefinition added in v0.6.0

func (o *Options) GetExtraTablesDefinition() *cli.StringFlag

GetExtraTablesDefinition returns the definition for directory flag.

func (*Options) GetExtraTablesSurvey added in v0.6.0

func (o *Options) GetExtraTablesSurvey() *cli.BoolFlag

GetExtraTablesSurvey returns the definition for title flag.

func (*Options) GetFileList

func (o *Options) GetFileList() *cli.StringSliceFlag

GetFileList returns the definition for file_list flag.

func (*Options) GetIDField

func (o *Options) GetIDField() *cli.StringFlag

GetIDField returns the definition for id_field flag.

func (*Options) GetOutputFilename

func (o *Options) GetOutputFilename() *cli.StringFlag

GetOutputFilename returns the definition for output_filename flag.

func (*Options) GetOutputPath

func (o *Options) GetOutputPath() *cli.StringFlag

GetOutputPath returns the definition for output_path flag.

func (*Options) GetTableNameCase

func (o *Options) GetTableNameCase() *cli.StringFlag

GetTableNameCase returns the definition for table_name_case flag.

func (*Options) GetTableNamePlural

func (o *Options) GetTableNamePlural() *cli.BoolFlag

GetTableNamePlural returns the definition for title flag.

func (*Options) GetTag

func (o *Options) GetTag() *cli.StringFlag

GetTag returns the definition for tag flag.

func (*Options) GetTitle

func (o *Options) GetTitle() *cli.StringFlag

GetTitle returns the definition for title flag.

func (*Options) Validate

func (o *Options) Validate() error

Validate the provided values to confirm that they are all correct.

type Reference added in v0.5.0

type Reference struct {
	FromTableName   string
	FromTableColumn string
	ToTableName     string
	TypeOfReference string
}

Reference describes the references for a table.

type Table added in v0.5.0

type Table struct {
	Name       string   `json:"name"`
	ColumnList []Column `json:"columns"`
	Color      string   `json:"color"`
}

Table describes the details of a table.

type TableAnswer added in v0.6.0

type TableAnswer struct {
	Name  string `survey:"table_name"`
	Color string `survey:"table_color"`
}

TableAnswer captures the answers for the table definition questions.

Jump to

Keyboard shortcuts

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