scaffold

package
v1.0.0-beta.15 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2022 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnknownScaffoldType = fmt.Errorf("unknown scaffold template")
View Source
var (
	ErrUnsupportedFormat = fmt.Errorf("unsupported format. supported formats are: JSON, TypeScript, Go, Java")
)
View Source
var ErrUnsupportedSchemaTemplate = fmt.Errorf("unknown bootstrap schema template")

Functions

func ExecFileTemplate

func ExecFileTemplate(fn string, tmpl string, vars any)

func InitGit

func InitGit(outDir string)

func Project

func Project(outDir string, pkgName string, dbName string, flavor string, colls []*api.CollectionDescription,
	lang string,
	clientID string,
	clientSecret string,
)

func Schema

func Schema(ctx context.Context, db string, format string, create bool, stdout bool) error

Types

type Collection

type Collection struct {
	Name      string // UserName
	NameDecap string // userName
	JSON      string // user_names
	Schema    string

	JSONSingular string // user_name

	NamePluralDecap string // userNames
	NamePlural      string // UserNames

	PrimaryKey []string

	HasTime bool
	HasUUID bool
}

type JSONToGo

type JSONToGo struct{}

func (*JSONToGo) GetFS

func (*JSONToGo) GetFS(dir string) embed.FS

func (*JSONToGo) HasTime

func (*JSONToGo) HasTime(schema string) bool

func (*JSONToGo) HasUUID

func (*JSONToGo) HasUUID(schema string) bool

type JSONToJava

type JSONToJava struct{}

func (*JSONToJava) GetFS

func (*JSONToJava) GetFS(dir string) embed.FS

func (*JSONToJava) HasTime

func (*JSONToJava) HasTime(schema string) bool

func (*JSONToJava) HasUUID

func (*JSONToJava) HasUUID(schema string) bool

type JSONToLangType

type JSONToLangType interface {
	HasTime(string) bool
	HasUUID(string) bool
	GetFS(dir string) embed.FS
}

type JSONToTypeScript

type JSONToTypeScript struct{}

func (*JSONToTypeScript) GetFS

func (*JSONToTypeScript) GetFS(dir string) embed.FS

func (*JSONToTypeScript) HasTime

func (*JSONToTypeScript) HasTime(schema string) bool

func (*JSONToTypeScript) HasUUID

func (*JSONToTypeScript) HasUUID(schema string) bool

Jump to

Keyboard shortcuts

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