Documentation ¶
Index ¶
- Variables
- func CmdInit(c *exec.Cmd, addGoPath bool, basePath string)
- func ContainsString(list []string, target string) bool
- func CopyDir(destDir, srcDir string, data map[string]interface{}) error
- func CopyFile(destFilename, srcFilename string) (err error)
- func DirExists(filename string) bool
- func Empty(dirname string) bool
- func Exists(filename string) bool
- func FindSrcPaths(appPath string, packageList []string, ...) (sourcePathsmap map[string]string, err error)
- func GenerateTemplate(filename, templateSource string, args map[string]interface{}) (err error)
- func InitLogger(basePath string, logLevel logger.LogLevel)
- func MustChmod(filename string, mode os.FileMode)
- func MustReadLines(filename string) []string
- func NewBuildIfError(err error, message string, args ...interface{}) (b error)
- func PanicOnError(err error, msg string)
- func ReadLines(filename string) ([]string, error)
- func RenderTemplate(destPath, srcPath string, data interface{}) (err error)
- func RenderTemplateToStream(output io.Writer, srcPath []string, data interface{}) (err error)
- func Retry(format string, args ...interface{})
- func TarGzDir(destFilename, srcDir string) (name string, err error)
- func Walk(root string, walkFn filepath.WalkFunc) error
- type BuildError
- type LoggedError
- type SourceError
- type SourceLine
Constants ¶
This section is empty.
Variables ¶
var Logger = logger.New()
var NO_APP_FOUND = errors.New("No app found")
var NO_REVEL_FOUND = errors.New("No revel found")
Functions ¶
func ContainsString ¶
Return true if the target string is in the list
func CopyDir ¶ added in v0.20.1
copyDir copies a directory tree over to a new directory. Any files ending in ".template" are treated as a Go template and rendered using the given data. Additionally, the trailing ".template" is stripped from the file name. Also, dot files and dot directories are skipped.
func FindSrcPaths ¶ added in v0.20.1
func FindSrcPaths(appPath string, packageList []string, packageResolver func(pkgName string) error) (sourcePathsmap map[string]string, err error)
Find the full source dir for the import path, uses the build.Default.GOPATH to search for the directory
func GenerateTemplate ¶ added in v0.20.1
GenerateTemplate renders the given template to produce source code, which it writes to the given file.
func InitLogger ¶
func MustReadLines ¶
MustReadLines reads the lines of the given file. Panics in the case of error.
func NewBuildIfError ¶ added in v0.20.1
Returns a new BuildError if err is not nil
func RenderTemplate ¶ added in v0.20.1
Given the target path and source path and data. A template
func RenderTemplateToStream ¶ added in v0.20.1
Given the target path and source path and data. A template
func Retry ¶
func Retry(format string, args ...interface{})
This function is to throw a panic that may be caught by the packger so it can perform the needed imports
Types ¶
type BuildError ¶ added in v0.20.1
type BuildError struct { Stack interface{} Message string Args []interface{} }
func NewBuildError ¶ added in v0.20.1
func NewBuildError(message string, args ...interface{}) (b *BuildError)
Returns a new builed error
func (*BuildError) Error ¶ added in v0.20.1
func (b *BuildError) Error() string
BuildError implements Error() string
type LoggedError ¶
type LoggedError struct {
// contains filtered or unexported fields
}
func NewLoggedError ¶
func NewLoggedError(err error) *LoggedError
type SourceError ¶ added in v1.0.7
type SourceError struct { SourceType string // The type of source that failed to build. Title, Path, Description string // Description of the error, as presented to the user. Line, Column int // Where the error was encountered. SourceLines []string // The entire source file, split into lines. Stack string // The raw stack trace string from debug.Stack(). MetaError string // Error that occurred producing the error page. Link string // A configurable link to wrap the error source in }
The error is a wrapper for the
func NewCompileError ¶ added in v1.0.7
func NewCompileError(importPath, errorLink string, error error) *SourceError
Parse the output of the "go build" command. Return a detailed Error.
func NewError ¶ added in v0.21.0
func NewError(source, title, path, description string) *SourceError
Return a new error object
func (*SourceError) ContextSource ¶ added in v1.0.7
func (e *SourceError) ContextSource() []SourceLine
ContextSource method returns a snippet of the source around where the error occurred.
func (*SourceError) Error ¶ added in v1.0.7
func (e *SourceError) Error() string
Error method constructs a plaintext version of the error, taking account that fields are optionally set. Returns e.g. Compilation Error (in views/header.html:51): expected right delim in end; got "}"
func (*SourceError) SetLink ¶ added in v1.0.7
func (e *SourceError) SetLink(errorLink string)
Creates a link based on the configuration setting "errors.link"
type SourceLine ¶
The error is a wrapper for the