resources

package
v0.0.0-...-768744d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 5, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bundle

type Bundle interface {
	Open(resourcePath string) (fs.File, error)
	Walk(walkFn fs.WalkDirFunc) error
	AbsPath(resourcePath string) string
	RelativePath(absPath string) string
	Get(resourcePath string) (Resource, error)
}

Bundle A bundle of resources

type Resource

type Resource interface {
	Path() string
	Bundle() Bundle
	Stat() os.FileInfo
	Open() (fs.File, error)
	Read() ([]byte, error)
	Copy(w io.Writer) (int64, error)
	Write(w http.ResponseWriter, urlPath string) error
	AsString() (string, error)
	Size() int64
	ContentType() string
}

Resource An individual resource

func Get

func Get(resourcePath string) (Resource, error)

func Resolve

func Resolve(relativePath string) (Resource, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL