Documentation
¶
Overview ¶
combiner appends a zip file to an executable and further appends a footer in the last 256 bytes that describes the combination. libzipfs will look for this footer and use it to determine where the internalized zipfile filesystem starts.
combiner appends a zip file to an executable and further appends a footer in the last 256 bytes that describes the combination. libzipfs will look for this footer and use it to determine where the internalized zipfile filesystem starts.
Index ¶
- Constants
- Variables
- func Blake2HashFile(path string) (hash []byte, length int64, err error)
- func DirExists(name string) bool
- func DisplayVersionAndExitIfRequested()
- func DoCombineExeAndZip(cfg *CombinerConfig) error
- func FileExists(name string) bool
- func FindMount() error
- func FindMountUmount() error
- func FindUmount() error
- func ShouldRetry(err error) bool
- func TSPrintf(format string, a ...interface{})
- func TrimTrailingSlashes(mountpoint string) string
- func VPrintf(format string, a ...interface{})
- func VersionString() string
- func WaitUntilMounted(mountPoint string) error
- func WaitUntilUnmounted(mountPoint string) error
- type CombinerConfig
- type Dir
- type FS
- type File
- type FileHandle
- type Footer
- type FooterArray
- type FuseZipFs
Constants ¶
const BLAKE2_HASH_LEN = 64
const LIBZIPFS_FOOTER_LEN = 256
const MAGIC_NUM_LEN = 16
Variables ¶
var GITLASTCOMMIT string // git rev-parse HEAD
var GITLASTTAG string // git describe --abbrev=0 --tags
track git version of this lib
var MAGIC1 = []byte("\nLibZipFs00\n")
var MAGIC2 = []byte("\nLibZipFsEnd\n")
var Verbose bool
Functions ¶
func DisplayVersionAndExitIfRequested ¶
func DisplayVersionAndExitIfRequested()
func DoCombineExeAndZip ¶
func DoCombineExeAndZip(cfg *CombinerConfig) error
func FileExists ¶
func FindMountUmount ¶
func FindMountUmount() error
func FindUmount ¶
func FindUmount() error
func ShouldRetry ¶
helper for reading in a loop. will panic on unknown error.
func TrimTrailingSlashes ¶
must trim any trailing slash from the mountpoint, or else mount can fail
func VersionString ¶
func VersionString() string
func WaitUntilMounted ¶
func WaitUntilUnmounted ¶
Types ¶
type CombinerConfig ¶
type CombinerConfig struct { ExecutablePath string ZipfilePath string OutputPath string Split bool }
func (*CombinerConfig) DefineFlags ¶
func (c *CombinerConfig) DefineFlags(fs *flag.FlagSet)
call DefineFlags before myflags.Parse()
func (*CombinerConfig) ValidateConfig ¶
func (c *CombinerConfig) ValidateConfig() error
call c.ValidateConfig() after myflags.Parse()
type Dir ¶
type Dir struct {
// contains filtered or unexported fields
}
type FileHandle ¶
type FileHandle struct {
// contains filtered or unexported fields
}
func (*FileHandle) Read ¶
func (fh *FileHandle) Read(ctx context.Context, req *fuse.ReadRequest, resp *fuse.ReadResponse) error
func (*FileHandle) Release ¶
func (fh *FileHandle) Release(ctx context.Context, req *fuse.ReleaseRequest) error
type Footer ¶
type Footer struct {}
func DoSplitOutExeAndZip ¶
func DoSplitOutExeAndZip(cfg *CombinerConfig) (*Footer, error)
func ReadFooter ¶
func ReadFooter(combinedPath string) (footerStartOffset int64, ft *Footer, comb *os.File, err error)
client take responsibility for closing combFd when done with it; it is the open file handled (if err == nil) for reading from the file at combinedPath.
func ReifyFooterAndDoInexpensiveChecks ¶
func ReifyFooterAndDoInexpensiveChecks(by []byte, combinedPath string, footerStartOffset int64) (*Footer, error)
must return err if foot is bad
func (*Footer) FillHashes ¶
func (foot *Footer) FillHashes(cfg *CombinerConfig) error
func (*Footer) GetFooterChecksum ¶
func (*Footer) VerifyExeZipChecksums ¶
func (foot *Footer) VerifyExeZipChecksums(cfg *CombinerConfig) (err error)
type FooterArray ¶
type FooterArray [LIBZIPFS_FOOTER_LEN]byte
type FuseZipFs ¶
type FuseZipFs struct { ZipfilePath string MountPoint string Ready chan bool ReqStop chan bool Done chan bool // contains filtered or unexported fields }
func MountComboZip ¶
The Main API entry point for mounting a combo file vis FUSE to make the embedded Zip file directory available. Users should call fzfs.Stop() when/if they wish to stop serving files at mountpoint.
func NewFuseZipFs ¶
func NewFuseZipFs(zipFilePath, mountpoint string, byteOffsetToZipFileStart int64, bytesAvail int64, footerBytes int64) *FuseZipFs
Mount a possibly combined/zipfile at mountpiont. Call Start() to start servicing fuse reads.
If the file has a libzipfs footer on it, set footerBytes == LIBZIPFS_FOOTER_LEN. The bytesAvail value should describe how long the zipfile is in bytes, and byteOffsetToZipFileStart should describe how far into the (possibly combined) zipFilePath the actual zipfile starts.
func NewFuzeZipFsFromCombo ¶
mount the comboFilePath file in a temp directory mountpoint created just for this purpose, and return the mountpoint and a handle to the fuse fileserver in fzfs.
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
cmd
|
|
libzipfs-combiner
combiner appends a zip file to an executable and further appends a footer in the last 256 bytes that describes the combination.
|
combiner appends a zip file to an executable and further appends a footer in the last 256 bytes that describes the combination. |