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.
Index ¶
- Constants
- func AskForConfirmation() bool
- func BeeFuncMap() template.FuncMap
- func BeeLastVersion() (version string)
- func CamelCase(in string) string
- func CamelString(s string) string
- func CheckEnv(appname string) (apppath, packpath string, err error)
- func CloseFile(f *os.File)
- func EndLine() string
- func FILE() string
- func FormatSourceCode(filename string)
- func GetBeeWorkPath() string
- func GetFileModTime(path string) int64
- func GetGOPATHs() []string
- func GetGoVersionSkipMinor() string
- func GetLastPublishedTime() string
- func Go(f func() error) chan error
- func GoCommand(command string, args ...string) error
- func IsBeegoProject(thePath string) bool
- func IsExist(path string) bool
- func IsGOMODULE() bool
- func IsInGOPATH(thePath string) bool
- func LINE() int
- func MacOSVersionSupport() bool
- func MustCheck(err error)
- func NoticeUpdateBee()
- func Notify(text, title string)
- func PrintErrorAndExit(message, errorTemplate string)
- func SearchGOPATHs(app string) (bool, string, string)
- func SnakeString(s string) string
- func SplitQuotedFields(in string) []string
- func Tmpl(text string, data interface{})
- func TmplToString(tmpl string, data interface{}) string
- func UpdateLastPublishedTime()
- func WriteToFile(filename, content string)
- type DocValue
- type ListOpts
- type Releases
- type Repos
- type StrFlags
Constants ¶
const BEEGO_VERSION = "v2.1.0"
Variables ¶
This section is empty.
Functions ¶
func AskForConfirmation ¶
func AskForConfirmation() bool
askForConfirmation uses Scanln to parse user input. A user must type in "yes" or "no" and then press enter. It has fuzzy matching, so "y", "Y", "yes", "YES", and "Yes" all count as confirmations. If the input is not recognized, it will ask again. The function does not return until it gets a valid response from the user. Typically, you should use fmt to print out a question before calling askForConfirmation. E.g. fmt.Println("WARNING: Are you sure? (yes/no)")
func BeeFuncMap ¶
BeeFuncMap returns a FuncMap of functions used in different templates.
func BeeLastVersion ¶
func BeeLastVersion() (version string)
func CamelCase ¶
camelCase converts a _ delimited string to camel case e.g. very_important_person => VeryImportantPerson
func CamelString ¶
func FormatSourceCode ¶
func FormatSourceCode(filename string)
formatSourceCode formats source files
func GetBeeWorkPath ¶
func GetBeeWorkPath() string
func GetFileModTime ¶
GetFileModTime returns unix timestamp of `os.File.ModTime` for the given path.
func GetGoVersionSkipMinor ¶
func GetGoVersionSkipMinor() string
func GetLastPublishedTime ¶ added in v2.0.3
func GetLastPublishedTime() string
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 IsBeegoProject ¶
IsBeegoProject checks whether the current path is a Beego application or not
func IsGOMODULE ¶
func IsGOMODULE() bool
func IsInGOPATH ¶
IsInGOPATH checks whether the path is inside of any GOPATH or not
func MacOSVersionSupport ¶
func MacOSVersionSupport() bool
func NoticeUpdateBee ¶
func NoticeUpdateBee()
func PrintErrorAndExit ¶
func PrintErrorAndExit(message, errorTemplate string)
func SearchGOPATHs ¶
SearchGOPATHs searchs the user GOPATH(s) for the specified application name. It returns a boolean, the application's GOPATH and its full path.
func SplitQuotedFields ¶
SplitQuotedFields is like strings.Fields but ignores spaces inside areas surrounded by single quotes. To specify a single quote use backslash to escape it: '\”
func TmplToString ¶
TmplToString parses a text template and return the result as a string.
func UpdateLastPublishedTime ¶ added in v2.0.3
func UpdateLastPublishedTime()
TODO merge UpdateLastPublishedTime and NoticeUpdateBee
func WriteToFile ¶
func WriteToFile(filename, content string)
WriteToFile creates a file and writes content to it
Types ¶
type Releases ¶ added in v2.0.3
type Releases struct { PublishedAt time.Time `json:"published_at"` TagName string `json:"tag_name"` }
func BeeReleasesInfo ¶ added in v2.0.3
func BeeReleasesInfo() (repos []Releases)
get info of bee releases