assets

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2024 License: MIT Imports: 11 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	TypeDir  = "fs/dir"
	TypeHtml = "text/html"
	TypeJs   = "text/js"
	TypeZip  = "application/zip"
)

Variables

This section is empty.

Functions

func FileType

func FileType(files fs.FS, filePath string) (string, error)

Types

type ArrayFs

type ArrayFs []fs.FS

func (ArrayFs) Open

func (cfs ArrayFs) Open(name string) (fs.File, error)

type DirStore

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

func NewDirStore

func NewDirStore(root string) *DirStore

func (*DirStore) Open

func (store *DirStore) Open(path string) (io.ReadCloser, error)

type FsStore

type FsStore struct {
	fs.FS
}

func (*FsStore) Open

func (fss *FsStore) Open(path string) (rc io.ReadCloser, err error)

type MapFS

type MapFS struct {
	Map map[string]fs.File
}

func (MapFS) Open

func (mfs MapFS) Open(name string) (fs.File, error)

type MemReadCloser

type MemReadCloser struct {
	io.Reader
}

func (MemReadCloser) Close

func (MemReadCloser) Close() error

type MemStore

type MemStore struct {
	Entries map[string][]byte
}

func (*MemStore) Open

func (store *MemStore) Open(path string) (io.ReadCloser, error)

type OsFS

type OsFS struct{}

func (OsFS) Open

func (s OsFS) Open(name string) (fs.File, error)

type OverlayStore

type OverlayStore struct {
	Stores []Store
}

func (*OverlayStore) Open

func (o *OverlayStore) Open(s string) (io.ReadCloser, error)

type Store

type Store interface {
	Open(string) (io.ReadCloser, error)
}

func SingleFileStore

func SingleFileStore(path string, name string) (s Store, err error)

type StoreHandler

type StoreHandler struct {
	Store
}

func (StoreHandler) ServeHTTP

func (sh StoreHandler) ServeHTTP(w http.ResponseWriter, req *http.Request)

type ZipStore

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

func NewZipStore

func NewZipStore(zipPath string) (*ZipStore, error)

func (*ZipStore) Open

func (store *ZipStore) Open(s string) (io.ReadCloser, error)

Jump to

Keyboard shortcuts

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