binder

command module
v0.0.0-...-0642096 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

README

Binder

Go Reference

Binder allows you to attach files to an executable and load the content at run time. It also includes an HTTP server routine to make it easy to serve static embedded content.

If you are on Go 1.16 or greater, you should consider using //go:embed instead of this tool. See the embed package.

Usage:

binder [-package <name>] files

The package name defaults to main.

Examples:

Embed the direct contents of the web and tpl folders, using the "foo" package:

binder -package foo web/* tpl/* > foo/files.go

Files can be looked up with:

content := foo.Lookup("/web/project.css")

You can server HTTP using:

http.Handle("/web/", http.HandlerFunc(foo.ServeHTTP))

In this example the files in tpl won't be served because the path is /web/. You can find the content at: http://localhost/web/project.css.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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