Skip to content

Latest commit

 

History

History
51 lines (41 loc) · 2.83 KB

README.md

File metadata and controls

51 lines (41 loc) · 2.83 KB

GoPkgr   GitHub release (latest by date)

A packager module/tool to pack templates/static files with the binary and extract it at the runtime.

Lines of code     GitHub go.mod Go version     GitHub All Releases     Platform

Installation

You can import this as a module and start using it.

go get github.com/cipheras/gopkgr

Or you can either use a precompiled binary package for your architecture or you can compile gopkgr from the source.

Download precompiled binary

Windows Linux
win-x64 linux-x64

For other versions or releases go to release page.

Compiling from source

In order to compile from source, make sure you have installed GO of version at least 1.15.0 (get it from here). When you have GO installed, type in the following:

go build 

Usage

Running gopkgr will generate a GO file which will contain data from all packed files.
Note: This file can become big if there are too many static files. Don't include images.

Using precompiled binary

Put the binary in the same dir in which the files which are to be packed are located and execute it.
It will automatically pack all files and files that are in folders and subfolders too.

Now you can use this file with your GO project and use unpacker function to unpack it at runtime. Call function in your code like,

err := unpkr(dir)


You can give path to where it should be extracted at the runtime.
Finally build your project.

gopkgr in action: example

License

gopkgr is made by @cipheras and is released under the terms of the  GitHub License

Contact   Twitter

Feel free to submit a bug, add features or issue a pull request.