assets

package
v0.0.0-...-d70c892 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: MIT Imports: 11 Imported by: 0

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 struct {
	Array []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 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