program

package
v0.10.4-0...-03c1e77 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package program provides the main functionality of ForgeX

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdvancedTemplates

type AdvancedTemplates struct {
	TemplateRoutes  string
	TemplateImports string
}

type DBDriverTemplater

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

type Docker

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

type DockerTemplater

type DockerTemplater interface {
	Docker() []byte
}

type Driver

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
	GitOptions        flags.Git
	OSCheck           map[string]bool
}

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

func (*Project) CheckOS

func (p *Project) CheckOS()

CheckOs checks Operation system and generates MakeFile and `go build` command Based on Project.Unixbase

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

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

func (p *Project) CreateWebsocketImports(appDir string)

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
	TestHandler() []byte
	HtmxTemplRoutes() []byte
	HtmxTemplImports() []byte
	WebsocketImports() []byte
}

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

type WorkflowTemplater

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