Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultIgnoredFolders = []string{".", "_", "vendor", "node_modules", "_fixtures", "testdata"}
Functions ¶
func FromArgs ¶
FromArgs is useful when writing packr store-cmd binaries.
package main
import (
"log"
"os"
"github.com/gobuffalo/packr/v2/jam/parser"
"github.com/markbates/s3packr/s3packr"
)
func main() {
err := parser.FromArgs(os.Args[1:], func(boxes parser.Boxes) error {
for _, box := range boxes {
s3 := s3packr.New(box)
if err := s3.Pack(box); err != nil {
return err
}
}
return nil
})
if err != nil {
log.Fatal(err)
}
}
func IsProspect ¶
Types ¶
type Box ¶
type Box struct {
Name string // name of the box
Path string // relative path of folder NewBox("./templates")
AbsPath string // absolute path of Path
Package string // the package name the box was found in
PWD string // the PWD when the parser was run
PackageDir string // the absolute path of the package where the box was found
}
Box found while parsing a file
type File ¶
File that is to be parsed
type ParsedFile ¶ added in v2.4.0
type ParsedFile struct {
File packd.SimpleFile
FileSet *token.FileSet
Ast *ast.File
Lines []string
}
ParsedFile ...
func ParseFile ¶ added in v2.4.0
func ParseFile(gf packd.SimpleFile) (ParsedFile, error)
ParseFile ...
func ParseFileMode ¶ added in v2.4.0
func ParseFileMode(gf packd.SimpleFile, mode parser.Mode) (ParsedFile, error)
ParseFileMode ...
type Parser ¶
Parser to find boxes
func NewFromRoots ¶
func NewFromRoots(roots []string, opts *RootsOptions) (*Parser, error)
NewFromRoots scans the file roots provided and returns a new Parser containing the prospects
type RootsOptions ¶
func (RootsOptions) String ¶
func (r RootsOptions) String() string
type Visitor ¶
type Visitor struct {
File packd.SimpleFile
Package string
// contains filtered or unexported fields
}
func NewVisitor ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.