tools

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CAESAR_UI_GITHUB_RAW_BASE_URL = "https://raw.githubusercontent.com/caesar-rocks/ui/master"

	DEFAULT_CSS_PATH                = "./views/app.css"
	DEFAULT_UI_COMPONENTS_BASE_PATH = "./views/ui"
)
View Source
const (
	EXCLUDED_PATHS = "node_modules|.git|.idea|vendor|.env|.DS_Store"
)
View Source
const (
	REPOSITORIES_BASE_DIR = "./app/repositories"
)
View Source
const (
	STARTER_KIT_GITHUB_REPO = "https://github.com/caesar-rocks/starter-kit.git"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AddUIComponentOpts

type AddUIComponentOpts struct {
	ComponentName string `description:"The name of the component you want to add to your codebase (lowercase, matching the .templ file name)"`
}

type MakeControllerOpts

type MakeControllerOpts struct {
	Input string `description:"The name of the controller to create"`
}

type MakeMigrationOpts

type MakeMigrationOpts struct {
	MigrationName string `description:"The name of the migration to create"`
}

type MakeModelOpts

type MakeModelOpts struct {
	ModelName      string `description:"The name of the model to create"`
	WithRepository bool   `description:"Whether to create a repository for the model"`
	WithMigration  bool   `description:"Whether to create a migration for the model"`
}

type MakeRepositoryOpts

type MakeRepositoryOpts struct {
	ModelName string `description:"The name of the model to create a repository for"`
}

type MakeValidatorOpts

type MakeValidatorOpts struct {
	ValidatiorName string `description:"The name of the validator to create"`
}

type ReadFileContentsOpts

type ReadFileContentsOpts struct {
	FilePath string `description:"The path to the file whose contents should be read"`
}

type SetupAppOpts

type SetupAppOpts struct {
	AppName string `description:"The name of the app you want to create"`
}

type ToolsWrapper

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

func NewToolsWrapper

func NewToolsWrapper(w io.Writer) *ToolsWrapper

func (*ToolsWrapper) AddUIComponent

func (wrapper *ToolsWrapper) AddUIComponent(opts AddUIComponentOpts) error

func (*ToolsWrapper) Inform

func (wrapper *ToolsWrapper) Inform(level inform.Level, message string, noColor ...bool)

func (*ToolsWrapper) ListFiles

func (wrapper *ToolsWrapper) ListFiles() error

ListFiles lists all files in the current directory recursively, excluding node_modules.

func (*ToolsWrapper) ListUiComponents

func (wrapper *ToolsWrapper) ListUiComponents() error

func (*ToolsWrapper) MakeController

func (wrapper *ToolsWrapper) MakeController(opts MakeControllerOpts) error

func (*ToolsWrapper) MakeMigration

func (wrapper *ToolsWrapper) MakeMigration(opts MakeMigrationOpts) error

func (*ToolsWrapper) MakeModel

func (wrapper *ToolsWrapper) MakeModel(opts MakeModelOpts) error

func (*ToolsWrapper) MakeRepository

func (wrapper *ToolsWrapper) MakeRepository(opts MakeRepositoryOpts) error

func (*ToolsWrapper) MakeValidator

func (wrapper *ToolsWrapper) MakeValidator(opts MakeValidatorOpts) error

func (*ToolsWrapper) ReadFileContents

func (wrapper *ToolsWrapper) ReadFileContents(opts ReadFileContentsOpts) error

ReadFileContents reads the contents of the specified file and returns them as a string.

func (*ToolsWrapper) SetupApp

func (wrapper *ToolsWrapper) SetupApp(opts SetupAppOpts) error

func (*ToolsWrapper) WriteContentsToFile

func (wrapper *ToolsWrapper) WriteContentsToFile(opts WriteContentsToFileOpts) error

WriteContentsToFile replaces the contents of the specified file with newContents.

type WriteContentsToFileOpts

type WriteContentsToFileOpts struct {
	FilePath    string `description:"The path to the file whose contents should be replaced"`
	NewContents string `description:"The new contents of the file"`
}

Jump to

Keyboard shortcuts

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