Skip to content

simple customizable tool to embed files in go

License

Notifications You must be signed in to change notification settings

themartorana/fileb0x

 
 

Repository files navigation

fileb0x Circle CI Coverage Status GoDoc GoReportCard

a simple customizable tool to embed files in go

features:

  • golint safe code output

  • optional: gzip compression (with optional run-time decompression)

  • optional: formatTed code (gofmt)

  • optional: spread files

  • optional: unexported variables, functions and types

  • optional: include multiple files and folders

  • optional: exclude files or/and folders

  • optional: replace text in files

  • optional: custom base and prefix path

  • Virtual Memory FileSystem - webdav

  • HTTP FileSystem and Handler

  • glob support - doublestar

  • json / yaml support

How to use it?

download:
go get -u github.com/UnnoTed/fileb0x 
run:

json config file example b0x.json

fileb0x b0x.json

yaml config file example b0x.yaml

fileb0x b0x.yaml
use:
Name Type Description
HTTP var - http.FileSystem Serve files through a HTTP FileServer http.ListenAndServe(":8080", http.FileServer(static.HTTP))
FS var - webdav.FileSystem In-Memory File System, you can read, write, remove, stat and rename files, make, remove and stat directories...
Handler var - http.Handler Serve file through a HTTP Handler http.ListenAndServe(":8080", static.Handler)
ReadFile func - ioutil.ReadFile Works the same way as ioutil.ReadFile but the file is read from FS
WriteFile func - ioutil.WriteFile Works the same way as ioutil.WriteFile but the file is written into FS
example:

simple example - main.go

About

simple customizable tool to embed files in go

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 97.3%
  • HTML 1.9%
  • Batchfile 0.8%