initialize

package
v0.51.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AllAppTypes = []AppType{
	AppTypeAPI,
	AppTypeWeb,
}

Functions

func ExcludeTemplateFile added in v0.48.0

func ExcludeTemplateFile(templateFileName string, project *Project, exclusions *FileExclusions) bool

func IsDirectoryEmpty added in v0.48.0

func IsDirectoryEmpty(name string) (bool, error)

func RemoveEmptyDirs added in v0.48.0

func RemoveEmptyDirs(paths map[string]bool) error

func RenameFiles added in v0.48.0

func RenameFiles(project *Project, outputPath string, renames *FileRenames) error

func Run added in v0.35.0

func Run(cfg *Config) error

Types

type AppType

type AppType string
const (
	AppTypeAPI AppType = "api"
	AppTypeWeb AppType = "web"
)

func (AppType) IsValid

func (t AppType) IsValid() bool

func (AppType) String added in v0.48.0

func (t AppType) String() string

type Authentication added in v0.48.0

type Authentication string
const (
	AuthenticationNone              Authentication = "none"
	AuthenticationEmail             Authentication = "email"
	AuthenticationEmailWithUsername Authentication = "email-with-username"
)

func (Authentication) IsValid added in v0.48.0

func (a Authentication) IsValid() bool

func (Authentication) RequiresDatabase added in v0.48.0

func (a Authentication) RequiresDatabase() bool

func (Authentication) String added in v0.48.0

func (a Authentication) String() string

type BackgroundJob added in v0.40.0

type BackgroundJob string
const (
	BackgroundJobNone  BackgroundJob = "none"
	BackgroundJobBasic BackgroundJob = "basic"
	BackgroundJobSQS   BackgroundJob = "sqs"
)

func (BackgroundJob) IsValid added in v0.40.0

func (t BackgroundJob) IsValid() bool

func (BackgroundJob) String added in v0.48.0

func (t BackgroundJob) String() string

type Command

type Command struct {
	Message string
	Name    string
	Args    []string
}

type Config

type Config struct {
	Quiet     bool
	OutputDir string
	Git       bool

	Name           string
	AppType        AppType
	Database       Database
	BackgroundJob  BackgroundJob
	Authentication Authentication

	SMTP           bool
	Storage        bool
	Redis          bool
	OAuthDiscord   bool
	OAuthFacebook  bool
	OAuthGitHub    bool
	OAuthGoogle    bool
	OAuthInstagram bool
	OAuthLinkedIn  bool
}

type Database

type Database string
const (
	DatabaseSQLite3  Database = "sqlite3"
	DatabasePostgres Database = "postgres"
	DatabaseMySQL    Database = "mysql"
	DatabaseNone     Database = "none"
)

func (Database) ConnString

func (d Database) ConnString(projectName string) string

func (Database) Driver

func (d Database) Driver() string

func (Database) Import

func (d Database) Import() string

func (Database) IsValid

func (d Database) IsValid() bool

func (Database) SQLCEngine

func (d Database) SQLCEngine() string

func (Database) String

func (d Database) String() string

type ExcludeFunc added in v0.48.0

type ExcludeFunc struct {
	FilePaths []string
	Check     func(*Project) bool
}

type FileExclusions

type FileExclusions struct {
	SMTP               []string
	Storage            []string
	Redis              []string
	Auth               []string
	OAuthGoogle        []string
	OAuthFacebook      []string
	OAuthGithub        []string
	OAuthLinkedIn      []string
	OAuthInstagram     []string
	OAuthDiscord       []string
	AppType            map[AppType][]string
	Database           map[Database][]string
	BackgroundJob      map[BackgroundJob][]string
	AuthenticationType map[Authentication][]string
	ExcludeFuncs       []*ExcludeFunc
}

func NewFileExclusions added in v0.48.0

func NewFileExclusions() *FileExclusions

type FileRenames

type FileRenames struct {
	ByAppType map[AppType]map[string]string
}

func NewFileRenames added in v0.48.0

func NewFileRenames() *FileRenames

type Project

type Project struct {
	Name           string
	AppType        AppType
	Database       Database
	BackgroundJob  BackgroundJob
	Authentication Authentication

	SMTP           bool
	Storage        bool
	Redis          bool
	OAuthDiscord   bool
	OAuthFacebook  bool
	OAuthGitHub    bool
	OAuthGoogle    bool
	OAuthInstagram bool
	OAuthLinkedIn  bool
}

func NewProject added in v0.48.0

func NewProject(cfg *Config) *Project

func (*Project) WithAuth added in v0.48.0

func (p *Project) WithAuth() bool

func (*Project) WithOAuth added in v0.48.0

func (p *Project) WithOAuth() bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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