gas: Index | Files

package gas

import ""


Package Files

fs.go gas.go gopath_go11.go

func Abs Uses

func Abs(file string) (string, error)

Return the absolute filepath for the requested resource or return an error if not found

func IsNotFound Uses

func IsNotFound(err error) bool

Return true if the error represents a NotFound error

func MustAbs Uses

func MustAbs(file string) string

MustAbs ensure that the given file is present in the system, if the file can't be found, this will call panic giving the reason

func Open Uses

func Open(file string) (io.ReadCloser, error)

Open the file for reading or returns an error

For more information, see the FS type

func ReadFile Uses

func ReadFile(file string) ([]byte, error)

ReadFile return the contents of the file at the given gopath

func Refresh Uses

func Refresh()

Refresh the internal FS to reflect possible changes in the UnitedFS

type FS Uses

type FS struct {
    // contains filtered or unexported fields

func FromDirs Uses

func FromDirs(dirs []string) *FS

FromDirs return a new filesystem that searchs for the request file on the specified dirs

This make a copy of the input array

func GopathFS Uses

func GopathFS() *FS

Create a new GopathFS instance

func UnitedFS Uses

func UnitedFS() *FS

Create a FS which is the combination of the GopathFS and the current folder note that the current folder don't require the "src" sub-folder

func (*FS) Abs Uses

func (fs *FS) Abs(file string, allowDir bool) (abs string, err error)

Find the absolute path for the required file.

The returned string is OS depended. If the desired file isn't present in any possible location returns NotFound error.

func (*FS) Open Uses

func (fs *FS) Open(file string) (r io.ReadCloser, err error)

Open the resource for reading

type NotFound Uses

type NotFound string

Used to indicat that the file wasn't found in any possible location

func (NotFound) Error Uses

func (n NotFound) Error() string

Package gas imports 7 packages (graph) and is imported by 22 packages. Updated 2016-07-20. Refresh now. Tools for package owners.