program

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2023 License: MIT Imports: 12 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 DBDriverTemplater added in v0.3.0

type DBDriverTemplater interface {
	Service() []byte
	Env() []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  string
	DBDriver     string
	FrameworkMap map[string]Framework
	DBDriverMap  map[string]Driver
}

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

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

Jump to

Keyboard shortcuts

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