scaffold

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: May 14, 2023 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnsupportedFormat    = fmt.Errorf("unsupported language. supported are: TypeScript, Go, Java")
	ErrTemplatesInvalidPath = fmt.Errorf("only local templates path substitution is allowed")

	ErrUnknownFramewrok = fmt.Errorf("unknown framework")
	ErrDirAlreadyExists = fmt.Errorf("output directory already exists")
)
View Source
var ErrUnknownScaffoldType = fmt.Errorf("unknown scaffold template")
View Source
var ErrUnsupportedSchemaTemplate = fmt.Errorf("unknown bootstrap schema template")

Functions

func CloneGitRepo

func CloneGitRepo(ctx context.Context, url string, path string)

func EnsureLocalExamples

func EnsureLocalExamples(lang string) string

func EnsureLocalTemplates

func EnsureLocalTemplates() string

func InitGit

func InitGit(outDir string)

func Project

func Project(cfg *Config)

func Schema

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

Types

type Collection

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

	JSONSingular string // user_name

	NamePluralDecap string // userNames
	NamePlural      string // UserNames

	PrimaryKey []string

	HasTime bool
	HasUUID bool
}

type Config

type Config struct {
	TemplatesPath   string
	OutputDirectory string
	PackageName     string
	ProjectName     string
	Example         string
	Framework       string
	Components      []string
	Collections     []*api.CollectionDescription
	Language        string
	URL             string
	ClientID        string
	ClientSecret    string
}

type JSONToGo

type JSONToGo struct{}

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) 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
}

type JSONToTypeScript

type JSONToTypeScript struct{}

func (*JSONToTypeScript) HasTime

func (*JSONToTypeScript) HasTime(schema string) bool

func (*JSONToTypeScript) HasUUID

func (*JSONToTypeScript) HasUUID(schema string) bool

type TmplVars

type TmplVars struct {
	URL                string
	Collections        []Collection
	Collection         Collection
	ProjectName        string
	ProjectNameCamel   string
	PackageName        string
	ClientID           string
	ClientSecret       string
	DatabaseBranchName string
}

Jump to

Keyboard shortcuts

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