Documentation ¶
Index ¶
- Constants
- func AskForConfirmation() bool
- func BhojpurWebFuncMap() template.FuncMap
- func BhojpurWebLastVersion() (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 GetBhojpurWebWorkPath() 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 IsBhojpurProject(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 NoticeUpdateBhojpur()
- 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 BHOJPUR_CLI_VERSION = "v0.0.8"
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 BhojpurWebFuncMap ¶
BhojpurWebFuncMap returns a FuncMap of functions used in different templates.
func BhojpurWebLastVersion ¶
func BhojpurWebLastVersion() (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 GetBhojpurWebWorkPath ¶
func GetBhojpurWebWorkPath() string
func GetFileModTime ¶
GetFileModTime returns unix timestamp of `os.File.ModTime` for the given path.
func GetGoVersionSkipMinor ¶
func GetGoVersionSkipMinor() string
func GetLastPublishedTime ¶
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 IsBhojpurProject ¶
IsBhojpurProject checks whether the current path is a Bhojpur Web 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 NoticeUpdateBhojpur ¶
func NoticeUpdateBhojpur()
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 ¶
func UpdateLastPublishedTime()
TODO merge UpdateLastPublishedTime and NoticeUpdateBhojpur
func WriteToFile ¶
func WriteToFile(filename, content string)
WriteToFile creates a file and writes content to it
Types ¶
type Releases ¶
type Releases struct { PublishedAt time.Time `json:"published_at"` TagName string `json:"tag_name"` }
func BhojpurWebReleasesInfo ¶
func BhojpurWebReleasesInfo() (repos []Releases)
get info of Bhojpur Web releases