bundle

package
v0.0.0-...-8444db5 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2022 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnknownBundleArchiveExt = errors.New("unknown bundle archive extension")

Functions

This section is empty.

Types

type ArchiveExt

type ArchiveExt string
const (
	ExtZip   ArchiveExt = "zip"
	ExtTarGz ArchiveExt = "tar.gz"
)

type Bundle

type Bundle interface {
	File(string) (io.ReadCloser, os.FileInfo, error)
	Dir(string) ([]os.FileInfo, error)
}

func FromPath

func FromPath(path string) (Bundle, error)

type DirectoryBundle

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

func NewDirectoryBundle

func NewDirectoryBundle(baseDir string) *DirectoryBundle

func (*DirectoryBundle) Dir

func (b *DirectoryBundle) Dir(dirname string) ([]os.FileInfo, error)

func (*DirectoryBundle) File

func (b *DirectoryBundle) File(filename string) (io.ReadCloser, os.FileInfo, error)

type File

type File struct {
	*bytes.Reader
	// contains filtered or unexported fields
}

func (*File) Close

func (f *File) Close() error

A noop-closer.

func (*File) Readdir

func (f *File) Readdir(count int) ([]os.FileInfo, error)

func (*File) Stat

func (f *File) Stat() (os.FileInfo, error)

type FileSystem

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

func NewFileSystem

func NewFileSystem(prefix string, bundle Bundle) *FileSystem

func (*FileSystem) Open

func (fs *FileSystem) Open(name string) (http.File, error)

type TarBundle

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

func NewTarBundle

func NewTarBundle(archivePath string) *TarBundle

func (*TarBundle) Dir

func (b *TarBundle) Dir(dirname string) ([]os.FileInfo, error)

func (*TarBundle) File

func (b *TarBundle) File(filename string) (io.ReadCloser, os.FileInfo, error)

type ZipBundle

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

func NewZipBundle

func NewZipBundle(archivePath string) *ZipBundle

func (*ZipBundle) Dir

func (b *ZipBundle) Dir(dirname string) ([]os.FileInfo, error)

func (*ZipBundle) File

func (b *ZipBundle) File(filename string) (io.ReadCloser, os.FileInfo, error)

Jump to

Keyboard shortcuts

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