pkg

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package pkg implements list function and variable that can be used by other packages

Package pkg implements list function and variable that can be used by other packages

Package pkg implements list function and variable that can be used by other packages

Package pkg implements list function and variable that can be used by other packages

Package pkg implements list function and variable that can be used by other packages

Package pkg implements list function and variable that can be used by other packages

Package pkg implements list function and variable that can be used by other packages

Index

Constants

View Source
const LatestGoVersion = "1.20"

Variables

View Source
var CLIVersion = "1.2.2"

CLIVersion is the version of the GIG CLI

View Source
var CreateSurveyQuestion = []*survey.Question{
	{
		Name: "http_framework",
		Prompt: &survey.Select{
			Message: "Choose a framework:",
			Options: []string{

				"gin",
			},
			Default:  "gin",
			PageSize: 10,
		},
		Validate: survey.Required,
	},
	{
		Name: "database",
		Prompt: &survey.Select{
			Message: "Choose database",
			Options: []string{
				"mysql",
				"postgresql",
			},
			Default:  "mysql",
			PageSize: 10,
		},
		Validate: survey.Required,
	},
	{
		Name: "use_orm",
		Prompt: &survey.Confirm{
			Message: "Do you want to use GORM?",
			Default: false,
		},
	},
}

CreateSurveyQuestion is the list of questions that will be asked to the user

View Source
var SupportedGoVersions = []string{"1.20", "1.19", "1.18"}

Functions

func GenerateFile

func GenerateFile(templateType string, fileName string, moduleName string, templateContent string, templateData any, path ...string)

GenerateFile generates a file from a template Accepts templateType, fileName, moduleName, templateContent, templateData

func GitClone

func GitClone(projectName, templateType string) error

Git clone template project from repository Accepts projectName, templateType Returns error

func PluralizeSnakeCase

func PluralizeSnakeCase(word string) string

PluralizeSnakeCase converts snake_case to plural snake_case Accepts snakeCase as string Returns string Example: snake_case -> snake_cases

func ReadJsonBool

func ReadJsonBool(key string) (bool, error)

ReadJsonBool reads a bool from a JSON file Accepts key as string Returns bool, error

func ReadJsonString

func ReadJsonString(key string) (string, error)

ReadJsonString reads a string from a JSON file Accepts key as string Returns string, error

func Replace

func Replace(path, old, new string)

Replace replaces oldString with the newString in all files in the path Accepts path, oldString, newString as string

func SnakeToCamel

func SnakeToCamel(snakeCase string) string

SnakeToCamel converts snake_case to camelCase Accepts snakeCase as string Returns string Example: snake_case -> snakeCase

func SnakeToPascal

func SnakeToPascal(snakeCase string) string

SnakeToCamel converts snake_case to camelCase Accepts snakeCase as string Returns string Example: snake_case -> SnakeCase

func StringTitle

func StringTitle(str string) string

StringTitle converts a string to title case Accepts str as string Returns string Example: hello world -> Hello World

Types

type CreateCommandAnswer

type CreateCommandAnswer struct {
	HttpFramework string `survey:"http_framework"`
	Database      string `survey:"database"`
	UseOrm        bool   `survey:"use_orm"`
}

CreateCommandAnswer is the answer from the create command

Directories

Path Synopsis
Package generate implements of generate files for command needs
Package generate implements of generate files for command needs

Jump to

Keyboard shortcuts

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