store

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2025 License: MIT Imports: 10 Imported by: 16

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HttpFile

func HttpFile(file fs.File) http.File

Types

type Dir

type Dir string

func (Dir) Open

func (d Dir) Open(name string) (fs.File, error)

func (Dir) ReadDir

func (d Dir) ReadDir(name string) ([]fs.DirEntry, error)

func (Dir) ReadFile

func (d Dir) ReadFile(name string) ([]byte, error)

type FS

type FS interface {
	Open(name string) (fs.File, error)
	ReadDir(name string) ([]fs.DirEntry, error)
	ReadFile(name string) ([]byte, error)
}

func PrefixFS added in v0.4.11

func PrefixFS(fs FS, prefix string) FS

type Item

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

func (*Item) Open

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

func (*Item) ReadDir

func (s *Item) ReadDir(name string) ([]fs.DirEntry, error)

func (*Item) ReadFile

func (s *Item) ReadFile(name string) ([]byte, error)

type Store

type Store struct {
	Items []FS
	// contains filtered or unexported fields
}

func (*Store) Add added in v0.4.11

func (s *Store) Add(fs FS)

func (*Store) AddDir added in v0.4.11

func (s *Store) AddDir(root string)

func (*Store) AddEmbedFS added in v0.4.11

func (s *Store) AddEmbedFS(fs *embed.FS)

func (*Store) AddZip added in v0.4.11

func (s *Store) AddZip(zip string)

func (*Store) Open

func (s *Store) Open(name string) (http.File, error)

func (*Store) OpenFile

func (s *Store) OpenFile(name string) (file fs.File, err error)

func (*Store) Remove added in v0.4.11

func (s *Store) Remove(fs FS)

type ZipFS

type ZipFS struct {
	Filename string
	// contains filtered or unexported fields
}

func (*ZipFS) Open

func (z *ZipFS) Open(name string) (file fs.File, err error)

func (*ZipFS) ReadDir

func (z *ZipFS) ReadDir(name string) (entries []fs.DirEntry, err error)

func (*ZipFS) ReadFile

func (z *ZipFS) ReadFile(name string) ([]byte, error)

Jump to

Keyboard shortcuts

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