Documentation ¶
Index ¶
- func CompressFile(filename string) (string, error)
- func DecompressHexString(hexdata string) ([]byte, error)
- func FindGoFiles(directory string) ([]string, error)
- func GeneratePackFileString(assetBundle *ReferencedAssets) (string, error)
- func GetMewnFiles(args ...string) []string
- func HasMewnReference(filename string) (bool, error)
- type AssetDirectory
- type AssignStmt
- type CallStmt
- type FileGroup
- func (f *FileGroup) AddAsset(name, data string) error
- func (f *FileGroup) Bytes(filename string) []byte
- func (f *FileGroup) Entries() []string
- func (f *FileGroup) MustBytes(filename string) []byte
- func (f *FileGroup) MustString(filename string) string
- func (f *FileGroup) Reset()
- func (f *FileGroup) String(filename string) string
- type Group
- type ReferencedAsset
- type ReferencedAssets
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompressFile ¶
CompressFile reads the given file and converts it to a gzip compressed hex string
func DecompressHexString ¶
DecompressHexString decompresses the gzip/hex encoded data
func FindGoFiles ¶
FindGoFiles finds all go files recursively from the given directory
func GeneratePackFileString ¶
func GeneratePackFileString(assetBundle *ReferencedAssets) (string, error)
GeneratePackFileString creates the contents of a pack file
func GetMewnFiles ¶
GetMewnFiles returns a list of files referencing mewn assets
func HasMewnReference ¶
HasMewnReference determines if the current file has a reference to the mewn library
Types ¶
type AssetDirectory ¶ added in v0.9.4
AssetDirectory is a collection of file groups
func NewAssetDirectory ¶ added in v0.9.4
func NewAssetDirectory() *AssetDirectory
NewAssetDirectory creates a new asset directory
func (*AssetDirectory) GetGroup ¶ added in v0.9.4
func (a *AssetDirectory) GetGroup(groupName string) *FileGroup
GetGroup gets a filegroup by name. Returns nil if not found
func (*AssetDirectory) NewFileGroup ¶ added in v0.9.4
func (a *AssetDirectory) NewFileGroup(baseDirectory string) (*FileGroup, error)
NewFileGroup creates a new file group
type AssignStmt ¶ added in v0.9.4
AssignStmt holds data about an assignment
func ParseAssignment ¶ added in v0.9.4
func ParseAssignment(astmt *ast.AssignStmt) *AssignStmt
ParseAssignment parses an assignment statement
func (*AssignStmt) String ¶ added in v0.9.4
func (a *AssignStmt) String() string
type CallStmt ¶ added in v0.9.4
CallStmt holds data about a call statement
func ParseCallExpr ¶ added in v0.9.4
ParseCallExpr parses a call expression for mewn related statements
type FileGroup ¶ added in v0.9.4
type FileGroup struct {
// contains filtered or unexported fields
}
FileGroup holds a collection of files
func (*FileGroup) Bytes ¶ added in v0.9.4
Bytes returns the asset as a Byte slice. Failure is indicated by a blank slice. If you need hard failures, use MustBytes.
func (*FileGroup) MustBytes ¶ added in v0.9.4
MustBytes returns the asset as a string. If the asset doesn't exist, it hard fails
func (*FileGroup) MustString ¶ added in v0.9.4
MustString returns the asset as a string. If the asset doesn't exist, it hard fails
type ReferencedAsset ¶
ReferencedAsset holds the information for an asset referenced by the user
type ReferencedAssets ¶
type ReferencedAssets struct { Caller string PackageName string BaseDir string Assets []*ReferencedAsset Groups []*Group }
ReferencedAssets is a collection of assets referenced from a file
func GetReferencedAssets ¶
func GetReferencedAssets(filenames []string) ([]*ReferencedAssets, error)
GetReferencedAssets gets a list of referenced assets from the AST
func (*ReferencedAssets) HasAsset ¶ added in v0.9.1
func (r *ReferencedAssets) HasAsset(name string) bool
HasAsset returns true if the given asset name has already been processed for this asset group