cmd

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2018 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BashCompletion bool
View Source
var ClientPrompts []*survey.Question
View Source
var Licenses = make(map[string]License)

Licenses contains all possible licenses a user can choose from.

View Source
var ProjectVersion string
View Source
var ReleaseVersion string
View Source
var Verbose int

Functions

func Execute

func Execute(releaseVersion string)

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

Types

type License

type License struct {
	Name            string   // The type of license in use
	PossibleMatches []string // Similar names to guess
	Text            string   // License text data
	Header          string   // License header for source files
}

License represents a software license agreement, containing the Name of the license, its possible matches (on the command line as given to cobra), the header to be used with each file on the file's creating, and the text of the license

type Project

type Project struct {
	AppName string

	Namespace      string
	Description    string
	Folder         folder
	ProjectDir     string
	ServiceName    string
	RelativeName   string
	PackageName    string
	Copyright      string
	Licenses       string
	ImportPath     string
	Address        string
	Port           int
	Domain         string
	NameLicense    string
	Author         string
	Fqdn           string
	IsSQLX         bool
	IsGORM         bool
	Driver         string
	ConfigFileName string
	// contains filtered or unexported fields
}

Project contains name, license and paths to projects.

func NewProject

func NewProject(projectName string) *Project

NewProject returns Project with specified project name.

func NewProjectFromPath

func NewProjectFromPath(absPath string) *Project

NewProjectFromPath returns Project with specified absolute path to package.

func (Project) AbsPath

func (p Project) AbsPath() string

AbsPath returns absolute path of project.

func (*Project) CamelCaseName

func (p *Project) CamelCaseName() string

CamelCaseName returns a CamelCased name of the service

func (*Project) CmdPath

func (p *Project) CmdPath() string

CmdPath returns absolute path to directory, where all commands are located.

func (*Project) License

func (p *Project) License() License

License returns the License object of project.

func (Project) Name

func (p Project) Name() string

Name returns the name of project, e.g. "github.com/spf13/cobra"

func (*Project) SnakeCaseName

func (p *Project) SnakeCaseName() string

SnakeCaseName returns a snake_cased_type name of the service

func (*Project) SrcPath

func (p *Project) SrcPath() string

SrcPath returns absolute path to $GOPATH/src where project is located.

Jump to

Keyboard shortcuts

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