mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 04:44:37 +03:00
Initial commit
This commit is contained in:
29
vendor/github.com/gobuffalo/packr/v2/pointer.go
generated
vendored
Normal file
29
vendor/github.com/gobuffalo/packr/v2/pointer.go
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
package packr
|
||||
|
||||
import (
|
||||
"github.com/gobuffalo/packr/v2/file"
|
||||
"github.com/gobuffalo/packr/v2/file/resolver"
|
||||
"github.com/gobuffalo/packr/v2/plog"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
type Pointer struct {
|
||||
ForwardBox string
|
||||
ForwardPath string
|
||||
}
|
||||
|
||||
var _ resolver.Resolver = Pointer{}
|
||||
|
||||
func (p Pointer) Resolve(box string, path string) (file.File, error) {
|
||||
plog.Debug(p, "Resolve", "box", box, "path", path, "forward-box", p.ForwardBox, "forward-path", p.ForwardPath)
|
||||
b, err := findBox(p.ForwardBox)
|
||||
if err != nil {
|
||||
return nil, errors.WithStack(err)
|
||||
}
|
||||
f, err := b.Resolve(p.ForwardPath)
|
||||
if err != nil {
|
||||
return f, errors.WithStack(errors.Wrap(err, path))
|
||||
}
|
||||
plog.Debug(p, "Resolve", "box", box, "path", path, "file", f)
|
||||
return f, nil
|
||||
}
|
||||
Reference in New Issue
Block a user