internal

package
v1.0.2020042521 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2020 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const VERSION = "1.0 20200425"

VERSION current version

Variables

This section is empty.

Functions

This section is empty.

Types

type AssetFile

type AssetFile interface {
	Name() string
	ModTime() time.Time
	Content() []byte
	ContentGzip() []byte
}

AssetFile one asset file

type AssetFiles

type AssetFiles interface {
	GetAssetFile(name string) (AssetFile, error)
	GetContent(name string) []byte
	GetFileNames(dir string) []string

	FileHandlerFunc(name string) http.HandlerFunc
	HTTPHandler(baseDir string) http.Handler
}

AssetFiles asset files

var Asset AssetFiles

Asset export assets

type Config

type Config struct {
	AssetDir    string `json:"src"`
	DestName    string `json:"dest"`
	PackageName string `json:"package"`
	Debug       string `json:"debug"`
	// contains filtered or unexported fields
}

Config 配置文件结构

func ParseConf

func ParseConf() (*Config, error)

ParseConf 解析出配置

func (*Config) String

func (conf *Config) String() string

type GoAsset

type GoAsset struct {
	Config  *Config
	Minify  *minify.M
	Files   []staticFile
	Tpl     *template.Template
	TestTpl *template.Template
	Helper  *assetHelper
}

GoAsset go asset tool

func (*GoAsset) Do

func (ga *GoAsset) Do() error

Do main func

type HelperFunc

type HelperFunc func(fileName string, content []byte) ([]byte, error)

HelperFunc 辅助方法的定义

Jump to

Keyboard shortcuts

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