packd: github.com/gobuffalo/packd Index | Files

package packd

import "github.com/gobuffalo/packd"

Index

Package Files

file.go file_info.go interfaces.go memory_box.go skip_walker.go version.go

Constants

const Version = "v0.0.1"

Version of packd

Variables

var CommonSkipPrefixes = []string{".", "_", "node_modules", "vendor"}

func SkipWalker Uses

func SkipWalker(walker Walker, skipPrefixes []string, wf WalkFunc) error

SkipWalker will walk the Walker and call the WalkFunc for files who's directories do no match any of the skipPrefixes. If no skipPrefixes are passed, then CommonSkipPrefixes is used

type Addable Uses

type Addable interface {
    AddString(path string, t string) error
    AddBytes(path string, t []byte) error
}

type Box Uses

type Box interface {
    HTTPBox
    Lister
    Addable
    Finder
    Walkable
    Haser
}

Box represents the entirety of the necessary interfaces to form a "full" box. github.com/gobuffalo/packr#Box is an example of this interface.

type File Uses

type File interface {
    HTTPFile
    FileInfo() (os.FileInfo, error)
}

func NewDir Uses

func NewDir(name string) (File, error)

NewDir returns a new "virtual" directory

func NewFile Uses

func NewFile(name string, r io.Reader) (File, error)

NewFile returns a new "virtual" file

type Finder Uses

type Finder interface {
    Find(string) ([]byte, error)
    FindString(name string) (string, error)
}

type HTTPBox Uses

type HTTPBox interface {
    Open(name string) (http.File, error)
}

type HTTPFile Uses

type HTTPFile interface {
    SimpleFile
    io.Closer
    io.Seeker
    Readdir(count int) ([]os.FileInfo, error)
    Stat() (os.FileInfo, error)
}

type Haser Uses

type Haser interface {
    Has(string) bool
}

type LegacyBox Uses

type LegacyBox interface {
    String(name string) string
    MustString(name string) (string, error)
    Bytes(name string) []byte
    MustBytes(name string) ([]byte, error)
}

LegacyBox represents deprecated methods that older Box implementations might have had. github.com/gobuffalo/packr v1 is an example of a LegacyBox.

type Lister Uses

type Lister interface {
    List() []string
}

type MemoryBox Uses

type MemoryBox struct {
    // contains filtered or unexported fields
}

MemoryBox is a thread-safe, in-memory, implementation of the Box interface.

func NewMemoryBox Uses

func NewMemoryBox() *MemoryBox

NewMemoryBox returns a configured *MemoryBox

func (*MemoryBox) AddBytes Uses

func (m *MemoryBox) AddBytes(path string, t []byte) error

func (*MemoryBox) AddString Uses

func (m *MemoryBox) AddString(path string, t string) error

func (*MemoryBox) Find Uses

func (m *MemoryBox) Find(path string) (ret []byte, e error)

func (*MemoryBox) FindString Uses

func (m *MemoryBox) FindString(path string) (string, error)

func (*MemoryBox) Has Uses

func (m *MemoryBox) Has(path string) bool

func (*MemoryBox) List Uses

func (m *MemoryBox) List() []string

func (*MemoryBox) Open Uses

func (m *MemoryBox) Open(path string) (http.File, error)

func (*MemoryBox) Remove Uses

func (m *MemoryBox) Remove(path string)

func (*MemoryBox) Walk Uses

func (m *MemoryBox) Walk(wf WalkFunc) error

func (*MemoryBox) WalkPrefix Uses

func (m *MemoryBox) WalkPrefix(pre string, wf WalkFunc) error

type SimpleFile Uses

type SimpleFile interface {
    fmt.Stringer
    io.Reader
    io.Writer
    Name() string
}

type WalkFunc Uses

type WalkFunc func(string, File) error

type Walkable Uses

type Walkable interface {
    Walker
    WalkPrefix(prefix string, wf WalkFunc) error
}

type Walker Uses

type Walker interface {
    Walk(wf WalkFunc) error
}

Package packd imports 11 packages (graph) and is imported by 21 packages. Updated 2018-12-14. Refresh now. Tools for package owners.