utility

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2024 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddAnotherFxOptionsInModule

func AddAnotherFxOptionsInModule(path, module, projectModule string) string

func AddAnotherFxProviderInModule added in v0.5.0

func AddAnotherFxProviderInModule(path, provider string) string

func AddListOfProvideInFxOptions added in v0.5.0

func AddListOfProvideInFxOptions(path string, providerList []string) string

func CheckGolangIdentifier

func CheckGolangIdentifier(identifier string) bool

func CheckVersion

func CheckVersion(goVersion string) string

func CopyFile added in v0.5.0

func CopyFile(src, dst string, templatesFS embed.FS) error

func ExecuteCommand added in v0.4.0

func ExecuteCommand(command string, args ...string) error

func Filter added in v0.5.0

func Filter[A any](input []A, f filterFunc[A]) []A

func FindGitRoot

func FindGitRoot(path string) (string, error)

func GenerateFiles

func GenerateFiles(templatesFS embed.FS, templatePath string, targetRoot string, data model.ModuleData) error

func GenerateFromEmbeddedTemplate added in v0.5.0

func GenerateFromEmbeddedTemplate(templatesFS embed.FS, path, targetFilePath string, data interface{})

func GenerateFromTemplate

func GenerateFromTemplate(templateFile, outputFile string, data model.ModuleData)

func GenerateFxModule added in v0.7.0

func GenerateFxModule()

func GetFunctionDeclarations added in v0.5.0

func GetFunctionDeclarations(path string, templatesFS embed.FS) []string

func GetModuleDataFromModuleName

func GetModuleDataFromModuleName(moduleName, projectModuleName, goVersion string) model.ModuleData

func GetModuleNameFromGoModFile

func GetModuleNameFromGoModFile() (model.GoMod, error)

func IgnoreWindowsPath added in v0.7.0

func IgnoreWindowsPath(p string) string

func ImportPackage

func ImportPackage(node *ast.File, projectModule, packageName string)

func ListDirectory added in v0.5.0

func ListDirectory(templatesFS embed.FS, dirPath string) []string

func Map added in v0.5.0

func Map[A, B any](input []A, m mapFunc[A, B]) []B

func PrintColorizeInfrastructureDetail added in v0.5.0

func PrintColorizeInfrastructureDetail(data model.ModuleData, infras []string)

func PrintColorizeModuleDetail

func PrintColorizeModuleDetail(data model.ModuleData)

func PrintColorizeProjectDetail

func PrintColorizeProjectDetail(data model.ModuleData)

func PrintColorizeServiceDetail added in v0.5.4

func PrintColorizeServiceDetail(data model.ModuleData, services []string)

func PrintFinalStepAfterInfrastructureAddition added in v0.5.0

func PrintFinalStepAfterInfrastructureAddition(data model.ModuleData)

func PrintFinalStepAfterModuleInitialization

func PrintFinalStepAfterModuleInitialization(data model.ModuleData)

func PrintFinalStepAfterProjectInitialization

func PrintFinalStepAfterProjectInitialization(data model.ModuleData)

func PrintFinalStepAfterServiceAddition added in v0.5.4

func PrintFinalStepAfterServiceAddition(data model.ModuleData)

func Reduce added in v0.5.0

func Reduce[A any](input []A, r reduceFunc[A], initial A) A

func WriteContentToPath

func WriteContentToPath(path, content string)

Types

type Module added in v0.7.0

type Module struct {
	PackageName string
	ModuleName  string
	Name        string
	Providers   []string
}

Jump to

Keyboard shortcuts

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