program

package
v0.5.5 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2024 License: MIT Imports: 16 Imported by: 4

Documentation

Overview

Package program provides the main functionality of Blueprint

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdvancedTemplates added in v0.5.0

type AdvancedTemplates struct {
	TemplateRoutes  template.HTML
	TemplateImports template.HTML
}

type DBDriverTemplater added in v0.3.0

type DBDriverTemplater interface {
	Service() []byte
	Env() []byte
}

type Docker added in v0.4.0

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

type DockerTemplater added in v0.4.0

type DockerTemplater interface {
	Docker() []byte
}

type Driver added in v0.3.0

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

type Framework

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

A Framework contains the name and templater for a given Framework

type Project

type Project struct {
	ProjectName       string
	Exit              bool
	AbsolutePath      string
	ProjectType       flags.Framework
	DBDriver          flags.Database
	Docker            flags.Database
	FrameworkMap      map[flags.Framework]Framework
	DBDriverMap       map[flags.Database]Driver
	DockerMap         map[flags.Database]Docker
	AdvancedOptions   map[string]bool
	AdvancedTemplates AdvancedTemplates
}

A Project contains the data for the project folder being created, and methods that help with that process

func (*Project) CreateFileWithInjection

func (p *Project) CreateFileWithInjection(pathToCreate string, projectPath string, fileName string, methodName string) error

CreateFileWithInjection creates the given file at the project path, and injects the appropriate template

func (*Project) CreateHtmxTemplates added in v0.5.0

func (p *Project) CreateHtmxTemplates()

func (*Project) CreateMainFile

func (p *Project) CreateMainFile() error

CreateMainFile creates the project folders and files, and writes to them depending on the selected options

func (*Project) CreatePath

func (p *Project) CreatePath(pathToCreate string, projectPath string) error

CreatePath creates the given directory in the projectPath

func (*Project) ExitCLI

func (p *Project) ExitCLI(tprogram *tea.Program)

ExitCLI checks if the Project has been exited, and closes out of the CLI if it has

type Templater

type Templater interface {
	Main() []byte
	Server() []byte
	Routes() []byte
	RoutesWithDB() []byte
	ServerWithDB() []byte
	TestHandler() []byte
	HtmxTemplRoutes() []byte
	HtmxTemplImports() []byte
}

A Templater has the methods that help build the files in the Project folder, and is specific to a Framework

type WorkflowTemplater added in v0.5.0

type WorkflowTemplater interface {
	Releaser() []byte
	Test() []byte
	ReleaserConfig() []byte
}

Jump to

Keyboard shortcuts

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