Documentation ¶
Overview ¶
You can use the "packr clean" command to clean up this, and any other packr generated files.
Index ¶
- Variables
- func AddService()
- func BuildAction(c *cli.Context) error
- func EnvFile() (string, error)
- func Exists(path string) bool
- func FormatCode(code []byte) ([]byte, error)
- func GetGOPATH() string
- func GetVersion() string
- func Getenv(key string) string
- func InitCommands() []*cli.Command
- func LowerFirst(s string) string
- func NewAction() cli.ActionFunc
- func NotPtr(s string) string
- func RunAction(c *cli.Context) error
- func RunCmd(name, dir, cmd string, args []string) (err error)
- func SearchGoMod(cwd string) (moduleName, path string, found bool)
- func UpperFirst(s string) string
- func WriteToFile(filename string, data []byte)
- type DbClient
- type Flags
- type StringSlice
- type Tool
- type VersionOptions
Constants ¶
This section is empty.
Variables ¶
var ( Version = "v0.0.1" BuildTime = time.Now().Format("2006-01-02 15:04:05") )
Functions ¶
func AddService ¶ added in v0.1.3
func AddService()
func BuildAction ¶
func BuildAction(c *cli.Context) error
func GetGOPATH ¶
func GetGOPATH() string
GetGOPATH retrieves the GOPATH from environment variables or the `go env` command.
func GetVersion ¶
func GetVersion() string
func InitCommands ¶
func InitCommands() []*cli.Command
func LowerFirst ¶
LowerFirst converts the first letter to upper case for the given string.
func SearchGoMod ¶
SearchGoMod searches go.mod from the given directory (which must be an absolute path) to the root directory. When the go.mod is found, its module name and path will be returned.
func UpperFirst ¶
UpperFirst converts the first letter to upper case for the given string.
func WriteToFile ¶
WriteToFile writes data into target file.
Types ¶
type Flags ¶
type Flags struct { ProjectName string ProjectPath string ServiceName string ModPrefix string RedisList []DbClient MysqlList []DbClient }
func (*Flags) ToNewAction ¶
func (f *Flags) ToNewAction() []cli.Flag
func (*Flags) ToServiceAction ¶
func (f *Flags) ToServiceAction() []cli.Flag
type StringSlice ¶
type StringSlice []string
StringSlice implements the flag.Value interface on string slices to allow a flag to be set multiple times.
func (*StringSlice) Set ¶
func (ss *StringSlice) Set(value string) error
Set implements the flag.Value interface.
func (*StringSlice) String ¶
func (ss *StringSlice) String() string
type Tool ¶
type Tool struct { Name string `json:"name"` Alias string `json:"alias"` BuildTime time.Time `json:"build_time"` Install string `json:"install"` Dir string `json:"dir"` Summary string `json:"summary"` Platform []string `json:"platform"` Author string `json:"author"` URL string `json:"url"` }
Tool is kratos tool.