goassets

package
v0.0.0-...-01a1fb0 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

打包资源文件

Index

Constants

This section is empty.

Variables

View Source
var (
	Assets = NewGoAssets()
)

Functions

This section is empty.

Types

type Asset

type Asset struct {
	Path    string
	Mode    os.FileMode
	ModTime time.Time
	Data    string
}

func (*Asset) GetRawData

func (this *Asset) GetRawData() ([]byte, error)

type AssetFS

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

func AssetsDir

func AssetsDir(path string) *AssetFS

func AssetsDirAllowedExts

func AssetsDirAllowedExts(path string, allowedExts []string) *AssetFS

func AssetsDirBlockedExts

func AssetsDirBlockedExts(path string, blockedExts []string) *AssetFS

func NewAssetFS

func NewAssetFS(path string, allowedExts, blockedExts []string) *AssetFS

func (*AssetFS) Open

func (this *AssetFS) Open(name string) (http.File, error)

type AssetFile

type AssetFile struct {
	*bytes.Reader
	io.Closer
	AssetFileInfo
}

func NewAssetFile

func NewAssetFile(name string, content []byte, timestamp time.Time) *AssetFile

func (*AssetFile) Readdir

func (this *AssetFile) Readdir(count int) ([]os.FileInfo, error)

func (*AssetFile) Size

func (this *AssetFile) Size() int64

func (*AssetFile) Stat

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

type AssetFileInfo

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

func (*AssetFileInfo) IsDir

func (this *AssetFileInfo) IsDir() bool

func (*AssetFileInfo) ModTime

func (this *AssetFileInfo) ModTime() time.Time

func (*AssetFileInfo) Mode

func (this *AssetFileInfo) Mode() os.FileMode

func (*AssetFileInfo) Name

func (this *AssetFileInfo) Name() string

func (*AssetFileInfo) Size

func (this *AssetFileInfo) Size() int64

func (*AssetFileInfo) Sys

func (this *AssetFileInfo) Sys() interface{}

type GoAssets

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

func NewGoAssets

func NewGoAssets() *GoAssets

func (*GoAssets) AddAsset

func (this *GoAssets) AddAsset(path string, modTime time.Time, data string)

func (*GoAssets) AddAssetPath

func (this *GoAssets) AddAssetPath(assetPath string)

func (*GoAssets) AddExt

func (this *GoAssets) AddExt(ext string)

func (*GoAssets) Build

func (this *GoAssets) Build(root, packageName, savePath string) error

func (*GoAssets) DecodeAsset

func (this *GoAssets) DecodeAsset(assetData string) ([]byte, error)

func (*GoAssets) Exists

func (this *GoAssets) Exists() bool

func (*GoAssets) GetAsset

func (this *GoAssets) GetAsset(name string) ([]byte, error)

func (*GoAssets) GetAssetPaths

func (this *GoAssets) GetAssetPaths() []string

func (*GoAssets) GetAssets

func (this *GoAssets) GetAssets() []Asset

func (*GoAssets) ReadAsset

func (this *GoAssets) ReadAsset(name string) (Asset, error)

func (*GoAssets) RemoveAssetPath

func (this *GoAssets) RemoveAssetPath(assetPath string)

func (*GoAssets) RemoveExt

func (this *GoAssets) RemoveExt(ext string)

func (*GoAssets) SetAssetPaths

func (this *GoAssets) SetAssetPaths(assetPaths []string)

func (*GoAssets) SetAssets

func (this *GoAssets) SetAssets(assets []Asset)

func (*GoAssets) SetExts

func (this *GoAssets) SetExts(exts []string)

Jump to

Keyboard shortcuts

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