assets

package
v0.0.0-...-4d9c86d Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2024 License: BSD-2-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FileExists

func FileExists(path string) (bool, error)

func FileExistsNoErr

func FileExistsNoErr(path string) bool

func MustExtractDBAsset

func MustExtractDBAsset(defaultDB string) string

Types

type AssetFile

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

Implements http.File

func (*AssetFile) Close

func (af *AssetFile) Close() error

func (*AssetFile) Read

func (af *AssetFile) Read(p []byte) (n int, err error)

func (*AssetFile) Readdir

func (af *AssetFile) Readdir(n int) (fi []os.FileInfo, err error)

func (*AssetFile) Seek

func (af *AssetFile) Seek(offset int64, whence int) (int64, error)

func (*AssetFile) Stat

func (af *AssetFile) Stat() (os.FileInfo, error)

type Bin

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

Bin wraps around all assets, both the baked-in, and on-disk.

func NewBin

func NewBin(roDir, wrDir string, log *slog.Logger) (*Bin, error)

NewBin creates a new Bin.

func (*Bin) FSOnly

func (a *Bin) FSOnly() *Bin

func (*Bin) Load

func (a *Bin) Load(path string) ([]byte, error)

func (*Bin) MustLoad

func (a *Bin) MustLoad(path string) []byte

func (*Bin) Open

func (a *Bin) Open(name string) (http.File, error)

func (*Bin) WriteRoot

func (a *Bin) WriteRoot() string

Jump to

Keyboard shortcuts

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