Documentation ¶
Index ¶
- Variables
- func CmdInit(c *exec.Cmd, 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(appImportPath, revelImportPath string, ...) (appSourcePath, revelSourcePath 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 Error
- type LoggedError
- type SourceLine
Constants ¶
This section is empty.
Variables ¶
var Logger = logger.New()
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(appImportPath, revelImportPath string, packageResolver func(pkgName string) error) (appSourcePath, revelSourcePath 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 Error ¶
type Error 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 (*Error) ContextSource ¶
func (e *Error) ContextSource() []SourceLine
ContextSource method returns a snippet of the source around where the error occurred.
type LoggedError ¶
type LoggedError struct {
// contains filtered or unexported fields
}
func NewLoggedError ¶
func NewLoggedError(err error) *LoggedError
type SourceLine ¶
The error is a wrapper for the