Documentation ¶
Overview ¶
Copyright 2017 bee authors
Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2013 bee authors ¶
Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Constants
- Variables
- func AutoBuild(files []string, isgenerate bool)
- func CloseFile(f *os.File)
- func Colorize(text string, status string) string
- func CopyFile(src, dst string)
- func EgoFuncMap() template.FuncMap
- func GetGOPATHs() []string
- func Go(f func() error) chan error
- func Help(args []string)
- func InitBanner(out io.Writer, in io.Reader)
- func IsEgoProject(thePath string) bool
- func IsGenerateDocs(name string, args []string) bool
- func IsInGOPATH(thePath string) bool
- func Kill()
- func MustCheck(err error)
- func NewWatcher(paths []string, files []string, isgenerate bool)
- func Now(layout string) string
- func PrintErrorAndExit(message string)
- func Restart(appname string)
- func SearchGOPATHs(app string) (bool, string, string)
- func ShowShortVersionBanner()
- func ShowVerboseVersionBanner()
- func Start(appname string)
- func TmplToString(tmpl string, data interface{}) string
- func Usage()
- func WriteToFile(filename, content string)
- func Writefile(fileName, writeStr string)
- type Annotation
- type AnnotationKind
- type ByteWriter
- type Code
- type Command
- type ListOpts
- type RuntimeInfo
Constants ¶
const ( // Header ... Header = `` /* 127-byte string literal not displayed */ Footer = `` /* 148-byte string literal not displayed */ )
const ( // MigrationMainTPL migration main template MigrationMainTPL = `` /* 647-byte string literal not displayed */ // MYSQLMigrationDDL MySQL migration SQL MYSQLMigrationDDL = `` /* 622-byte string literal not displayed */ // POSTGRESMigrationDDL Postgres migration SQL POSTGRESMigrationDDL = `` /* 286-byte string literal not displayed */ )
const ( // BaleHeader ... BaleHeader = `` /* 848-byte string literal not displayed */ )
Variables ¶
var AvailableCommands = []*Command{
cmdNew,
cmdRun,
cmdPack,
cmdApi,
cmdRiot,
cmdGse,
cmdBale,
cmdVersion,
cmdMigrate,
cmdFix,
}
Functions ¶
func EgoFuncMap ¶
EgoFuncMap returns a FuncMap of functions used in different templates.
func Go ¶
Go is a basic promise implementation: it wraps calls a function in a goroutine and returns a channel which will later return the function's return value.
func InitBanner ¶
InitBanner loads the banner and prints it to output All errors are ignored, the application will not print the banner in case of error.
func IsEgoProject ¶
IsEgoProject checks whether the current path is a Egogo application or not
func IsGenerateDocs ¶
func IsInGOPATH ¶
IsInGOPATH checks the path is in the fisrt GOPATH(/src) or not
func NewWatcher ¶
NewWatcher starts an fsnotify Watcher on the specified paths
func PrintErrorAndExit ¶
func PrintErrorAndExit(message string)
func Restart ¶
func Restart(appname string)
Restart kills the running command process and starts it again
func SearchGOPATHs ¶
SearchGOPATHs searches the user GOPATH(s) for the specified application name. It returns a boolean, the application's GOPATH and its full path.
func ShowShortVersionBanner ¶
func ShowShortVersionBanner()
ShowShortVersionBanner prints the short version banner.
func ShowVerboseVersionBanner ¶
func ShowVerboseVersionBanner()
ShowVerboseVersionBanner prints the verbose version banner
func TmplToString ¶
TmplToString parses a text template and return the result as a string.
func WriteToFile ¶
func WriteToFile(filename, content string)
WriteToFile creates a file and writes content to it
Types ¶
type Annotation ¶
type Annotation struct {
Pos, End int16
Kind AnnotationKind
ImportPath string
}
type AnnotationKind ¶
type AnnotationKind int16
const ( ExportLinkAnnotation AnnotationKind = iota AnchorAnnotation CommentAnnotation PackageLinkAnnotation BuiltinAnnotation )
type ByteWriter ¶
ByteWriter ...
type Code ¶
type Code struct { Text string Annotations []Annotation }
type Command ¶
type Command struct { // Run runs the command. // The args are the arguments after the command name. Run func(cmd *Command, args []string) int // PreRun performs an operation before running the command PreRun func(cmd *Command, args []string) // UsageLine is the one-line usage message. // The first word in the line is taken to be the command name. UsageLine string // Short is the short description shown in the 'go help' output. Short string // Long is the long message shown in the 'go help <this-command>' output. Long string // Flag is a set of flags specific to this command. Flag flag.FlagSet // CustomFlags indicates that the command will do its own // flag parsing. CustomFlags bool // contains filtered or unexported fields }
Command is the unit of execution
func (*Command) Out ¶
Out returns the out writer of the current command. If cmd.output is nil, os.Stderr is used.
func (*Command) Runnable ¶
Runnable reports whether the command can be run; otherwise it is a documentation pseudo-command such as import path.