language

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2022 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterLanguage

func RegisterLanguage(l Language)

RegisterLanguage registers a language

Types

type GoLanguage

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

Golang represents a golang language

func NewGoLanguage

func NewGoLanguage() *GoLanguage

func (*GoLanguage) BindTarget

func (g *GoLanguage) BindTarget(target *conf.ReverseTarget)

func (*GoLanguage) FormatGo

func (g *GoLanguage) FormatGo(src string) (string, error)

func (*GoLanguage) GenGoImports

func (g *GoLanguage) GenGoImports(tables []*schemas.Table) []string

func (*GoLanguage) GetExtName

func (g *GoLanguage) GetExtName() string

func (*GoLanguage) GetFormatter

func (g *GoLanguage) GetFormatter() func(string) (string, error)

func (*GoLanguage) GetFuncs

func (g *GoLanguage) GetFuncs() template.FuncMap

func (*GoLanguage) GetImportter

func (g *GoLanguage) GetImportter() func([]*schemas.Table) []string

func (*GoLanguage) GetName

func (g *GoLanguage) GetName() string

func (*GoLanguage) GetTemplate

func (g *GoLanguage) GetTemplate() string

func (*GoLanguage) GetTypes

func (g *GoLanguage) GetTypes() map[string]string

func (*GoLanguage) Tag

func (g *GoLanguage) Tag(table *schemas.Table, col *schemas.Column) template.HTML

func (*GoLanguage) TypeString

func (g *GoLanguage) TypeString(col *schemas.Column) string

type Language

type Language interface {
	GetName() string
	GetTemplate() string
	GetTypes() map[string]string
	GetFuncs() template.FuncMap
	GetFormatter() func(string) (string, error)
	GetImportter() func([]*schemas.Table) []string
	GetExtName() string
	BindTarget(*conf.ReverseTarget)
}

Language represents a languages supported when reverse codes

func GetLanguage

func GetLanguage(name string, tableName bool) Language

GetLanguage returns a language if exists

Jump to

Keyboard shortcuts

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