pack

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2020 License: MIT Imports: 7 Imported by: 1

README

pack

用于静态资源打包成一个 Go 文件

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bytes

func Bytes(v interface{}) ([]byte, error)

Bytes 将 v 打包成一份合法的 Go []byte 类型

func File

func File(v interface{}, pkgName, varName, fileHeader, tag, path string) error

File 将对象 v 打包成一个 Go 文件内容中

pkgName 和 varName 分别指定包名和变量名; fileHeader 指定了文件头,如果为空,则不会输出文件内容; tag 指定了 // +build 指令下的标签,如果为空则不生成该指令;

func String

func String(v interface{}) (string, error)

String 将 v 打包成一份合法的 Go 字符串

func Unpack

func Unpack(buffer string, v interface{}) error

Unpack 用于解压由 Bytes 或是 String 打包的内容

Types

This section is empty.

Jump to

Keyboard shortcuts

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