resources

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CompressFS

type CompressFS struct {
	*embed.FS
	// contains filtered or unexported fields
}

CompressFS is a simple tools to read file from embed.FS and gzip compress file only support ReadFile method, not support Open method

var YsoResourceFS *CompressFS

func NewCompressFS

func NewCompressFS(fs *embed.FS, compressDirs map[string]string) *CompressFS

NewCompressFS create a CompressFS instance fs is embed.FS instance, compressDirs is a map, key is virtual dir, value is compress file name

func (*CompressFS) ReadFile

func (c *CompressFS) ReadFile(name string) ([]byte, error)

ReadFile override embed.FS.ReadFile, if file is compress file, return decompress data

Jump to

Keyboard shortcuts

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