package packd
import "github.com/gobuffalo/packd"
Index ¶
- Constants
- Variables
- func SkipWalker(walker Walker, skipPrefixes []string, wf WalkFunc) error
- type Addable
- type Box
- type ByteMap
- func (m *ByteMap) Delete(key string)
- func (m *ByteMap) Keys() []string
- func (m *ByteMap) Load(key string) ([]byte, bool)
- func (m *ByteMap) LoadOrStore(key string, value []byte) ([]byte, bool)
- func (m *ByteMap) Range(f func(key string, value []byte) bool)
- func (m *ByteMap) Store(key string, value []byte)
- type File
- type Finder
- type HTTPBox
- type HTTPFile
- type Haser
- type LegacyBox
- type Lister
- type MemoryBox
- func NewMemoryBox() *MemoryBox
- func (m *MemoryBox) AddBytes(path string, t []byte) error
- func (m *MemoryBox) AddString(path string, t string) error
- func (m *MemoryBox) Find(path string) (ret []byte, e error)
- func (m *MemoryBox) FindString(path string) (string, error)
- func (m *MemoryBox) Has(path string) bool
- func (m *MemoryBox) List() []string
- func (m *MemoryBox) Open(path string) (http.File, error)
- func (m *MemoryBox) Remove(path string)
- func (m *MemoryBox) Walk(wf WalkFunc) error
- func (m *MemoryBox) WalkPrefix(pre string, wf WalkFunc) error
- type SimpleFile
- type WalkFunc
- type Walkable
- type Walker
Constants ¶
const Version = "v0.3.0"
Version of packd
Variables ¶
var CommonSkipPrefixes = []string{".", "_", "node_modules", "vendor"}
Functions ¶
func SkipWalker ¶
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
Types ¶
type Addable ¶
type Addable interface { AddString(path string, t string) error AddBytes(path string, t []byte) error }
type Box ¶
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 ByteMap ¶
type ByteMap struct {
// contains filtered or unexported fields
}
ByteMap wraps sync.Map and uses the following types: key: string value: []byte
func (*ByteMap) Delete ¶
Delete the key from the map
func (*ByteMap) Keys ¶
Keys returns a list of keys in the map
func (*ByteMap) Load ¶
Load the key from the map. Returns []byte or bool. A false return indicates either the key was not found or the value is not of type []byte
func (*ByteMap) LoadOrStore ¶
LoadOrStore will return an existing key or store the value if not already in the map
func (*ByteMap) Range ¶
Range over the []byte values in the map
func (*ByteMap) Store ¶
Store a []byte in the map
type File ¶
func NewDir ¶
NewDir returns a new "virtual" directory
func NewFile ¶
NewFile returns a new "virtual" file
type Finder ¶
type HTTPBox ¶
type HTTPFile ¶
type HTTPFile interface { SimpleFile io.Closer io.Seeker Readdir(count int) ([]os.FileInfo, error) Stat() (os.FileInfo, error) }
type Haser ¶
type LegacyBox ¶
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 ¶
type Lister interface { List() []string }
type MemoryBox ¶
type MemoryBox struct {
// contains filtered or unexported fields
}
MemoryBox is a thread-safe, in-memory, implementation of the Box interface.
func NewMemoryBox ¶
func NewMemoryBox() *MemoryBox
NewMemoryBox returns a configured *MemoryBox
func (*MemoryBox) AddBytes ¶
func (*MemoryBox) AddString ¶
func (*MemoryBox) Find ¶
func (*MemoryBox) FindString ¶
func (*MemoryBox) Has ¶
func (*MemoryBox) List ¶
func (*MemoryBox) Open ¶
func (*MemoryBox) Remove ¶
func (*MemoryBox) Walk ¶
func (*MemoryBox) WalkPrefix ¶
type SimpleFile ¶
type WalkFunc ¶
type Walkable ¶
type Walker ¶
Source Files ¶
file.go file_info.go interfaces.go map.go memory_box.go skip_walker.go version.go
Directories ¶
Path | Synopsis |
---|---|
internal |
- Version
- v1.0.2 (latest)
- Published
- Sep 3, 2022
- Platform
- linux/amd64
- Imports
- 11 packages
- Last checked
- 1 week ago –
Tools for package owners.