resources

package
v0.9.26 Latest Latest
Warning

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

Go to latest
Published: May 29, 2024 License: MIT Imports: 6 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Resource

type Resource interface {
	Path() string

	SimpleName() string

	Size() int64

	ReadBinary() ([]byte, error)

	ReadText() (string, error)

	Open() (io.ReadCloser, error)
}

Resource 表示一个资源

type Table

type Table interface {
	Paths() []string

	GetResource(path string) (Resource, error)

	Export(dst map[string]Resource) map[string]Resource

	Import(src map[string]Resource)

	ReadBinary(path string) ([]byte, error)

	ReadText(path string) (string, error)

	Open(path string) (io.ReadCloser, error)
}

Table 表示一个资源的集合

func NewEmbed

func NewEmbed(fs embed.FS, basepath string) Table

NewEmbed 用 embed.FS 新建资源

func NewTable

func NewTable(src map[string]Resource, mode safe.Mode) Table

NewTable 新建属性表

Jump to

Keyboard shortcuts

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