commands

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2022 License: MIT Imports: 24 Imported by: 0

Documentation

Overview

You can use the "packr clean" command to clean up this, and any other packr generated files.

Index

Constants

This section is empty.

Variables

View Source
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 EnvFile

func EnvFile() (string, error)

EnvFile returns the name of the Go environment configuration file.

func Exists

func Exists(path string) bool

Exists reports whether a file exists.

func FormatCode

func FormatCode(code []byte) ([]byte, error)

FormatCode formats go source codes.

func GetGOPATH

func GetGOPATH() string

GetGOPATH retrieves the GOPATH from environment variables or the `go env` command.

func GetVersion

func GetVersion() string

func Getenv

func Getenv(key string) string

Getenv gets the value from env or configuration.

func InitCommands

func InitCommands() []*cli.Command

func LowerFirst

func LowerFirst(s string) string

LowerFirst converts the first letter to upper case for the given string.

func NewAction

func NewAction() cli.ActionFunc

func NotPtr

func NotPtr(s string) string

NotPtr converts an pointer type into non-pointer type.

func RunAction

func RunAction(c *cli.Context) error

func RunCmd

func RunCmd(name, dir, cmd string, args []string) (err error)

func SearchGoMod

func SearchGoMod(cwd string) (moduleName, path string, found bool)

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

func UpperFirst(s string) string

UpperFirst converts the first letter to upper case for the given string.

func WriteToFile

func WriteToFile(filename string, data []byte)

WriteToFile writes data into target file.

Types

type DbClient

type DbClient struct {
	ConfigName string
	ClientName string
}

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.

type VersionOptions

type VersionOptions struct {
	Version   string
	BuildTime string
	GoVersion string
	Os        string
	Arch      string
}

VersionOptions include version

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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