resemble

package module
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2021 License: BSD-3-Clause Imports: 8 Imported by: 6

README

go-resemble is a RESource EMBedder Like Every other.

Installation

go get -u github.com/thijzert/go-resemble/...

Usage

To embed all files in a directory assets/, run:

go-resemble -o assets.go assets

This writes a file assets.go which contains all files in the earlier directory. This file defines a function getAsset(name string) ([]byte, error) that can be used to retrieve the original file's contents.

You can also create a debug build like this:

go-resemble -debug -o assets.go assets

A debug build creates the same getAsset function, but keeps reading the files from disk. This is useful during development.

License

Copyright (c) 2019 Thijs van Dijk, all rights reserved. Redistribution and use is permitted under the terms of the BSD 3-clause (revised) license. See the file LICENSE or this url for details.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Resemble

type Resemble struct {
	// The resulting output file (e.g. 'assets.go')
	OutputFile string

	// The package name where the output file lives (e.g. 'fooserver')
	PackageName string

	// For development builds, rather than embedding file contents in source,
	// add a wrapper with the same interface that loads files from disk
	Debug bool

	// Root paths to every asset to be embedded. Directories are traversed recursively.
	AssetPaths []string
}

The Resemble wraps all options for EMBedding RESources into a static file

func (Resemble) Run

func (r Resemble) Run() error

Run creates the output file containing all static resources

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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