saas

package
v0.0.0-...-33ac1c0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2024 License: MIT Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cmd

func Cmd() *cobra.Command

func ConvertToTypeScriptType

func ConvertToTypeScriptType(goType string) string

ConvertToTypeScriptType converts Go types to TypeScript types

func WithDB

func WithDB(db types.DBType) optFunc[SaaSBuilder]

func WithDir

func WithDir(dir string) optFunc[SaaSBuilder]

dir, moduleName, serviceName string, db types.DBType, router types.RouterType, siteSpec *spec.SiteSpec

func WithExternalDockerNetwork

func WithExternalDockerNetwork(externalDockerNetwork string) optFunc[SaaSBuilder]

func WithIsService

func WithIsService(isService bool) optFunc[SaaSBuilder]

func WithModuleName

func WithModuleName(moduleName string) optFunc[SaaSBuilder]

func WithRouter

func WithRouter(router types.RouterType) optFunc[SaaSBuilder]

func WithServiceName

func WithServiceName(serviceName string) optFunc[SaaSBuilder]

func WithSiteSpec

func WithSiteSpec(siteSpec *spec.SiteSpec) optFunc[SaaSBuilder]

func WriteApiProperty

func WriteApiProperty(writer io.Writer, name, tp string, isOptional bool, indent int) error

WriteApiProperty writes a TypeScript property definition

Types

type SaaSBuilder

type SaaSBuilder struct {
	Dir                   string
	ModuleName            string
	ServiceName           string
	DB                    types.DBType
	Router                types.RouterType
	Spec                  *spec.SiteSpec
	Data                  map[string]any
	Themes                map[string]string
	EmbeddedFS            []embeddedFS
	HasEmbeddedFS         bool
	CustomFuncs           map[string]customFunc
	RenameFiles           map[string]string
	IgnoreFiles           map[string]bool
	IgnorePaths           map[string]bool
	OverwriteFiles        map[string]bool
	IsService             bool
	ExternalDockerNetwork string
}

func NewSaaSBuilder

func NewSaaSBuilder(opts ...optFunc[SaaSBuilder]) *SaaSBuilder

func (*SaaSBuilder) Execute

func (sb *SaaSBuilder) Execute() error

func (*SaaSBuilder) WithCustomFunc

func (sb *SaaSBuilder) WithCustomFunc(filePath string, fn customFunc)

func (*SaaSBuilder) WithData

func (sb *SaaSBuilder) WithData(data map[string]any)

func (*SaaSBuilder) WithIgnoreFile

func (sb *SaaSBuilder) WithIgnoreFile(file string)

func (*SaaSBuilder) WithIgnoreFiles

func (sb *SaaSBuilder) WithIgnoreFiles(files ...string)

func (*SaaSBuilder) WithIgnorePath

func (sb *SaaSBuilder) WithIgnorePath(path string)

func (*SaaSBuilder) WithIgnorePaths

func (sb *SaaSBuilder) WithIgnorePaths(paths ...string)

func (*SaaSBuilder) WithOverwriteFile

func (sb *SaaSBuilder) WithOverwriteFile(file string)

func (*SaaSBuilder) WithOverwriteFiles

func (sb *SaaSBuilder) WithOverwriteFiles(files ...string)

func (*SaaSBuilder) WithRenameFile

func (sb *SaaSBuilder) WithRenameFile(oldName, newName string)

func (*SaaSBuilder) WithRenameFiles

func (sb *SaaSBuilder) WithRenameFiles(files map[string]string)

Directories

Path Synopsis
templates

Jump to

Keyboard shortcuts

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