Documentation ¶
Overview ¶
Package embedbin provides a portable way to install embedded binaries.
The Install function creates a temporary file and writes the contents to it.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Installed ¶
Installed is a handle to an installed binary. Users must call Uninstall to clean it up.
type MemfdInstall ¶
type MemfdInstall struct {
// contains filtered or unexported fields
}
MemfdInstall uses memfd to temporarily get and fd / path for the embedded binary.
func (*MemfdInstall) IsRegular ¶
func (m *MemfdInstall) IsRegular() bool
IsRegular returns false for memfdInstall. The file is a memfd, not a regular file.
func (*MemfdInstall) Path ¶
func (m *MemfdInstall) Path() string
Path returns the path to the memfd.
func (*MemfdInstall) Uninstall ¶
func (m *MemfdInstall) Uninstall() error
Uninstall closes the memfd. The file is automatically removed when the last process closes it.
type MemfdInstaller ¶
type MemfdInstaller struct {
// contains filtered or unexported fields
}
MemfdInstaller installs embedded binaries.
type RegularInstall ¶
type RegularInstall struct {
// contains filtered or unexported fields
}
RegularInstall uses a regular file to install an embedded binary.
func (*RegularInstall) IsRegular ¶
func (r *RegularInstall) IsRegular() bool
IsRegular returns true for regularInstall. It is always backed by a regular file.
func (*RegularInstall) Path ¶
func (r *RegularInstall) Path() string
Path returns the path to the regular file.
func (*RegularInstall) Uninstall ¶
func (r *RegularInstall) Uninstall() error
Uninstall removes the regular file.
type RegularInstaller ¶
type RegularInstaller struct {
// contains filtered or unexported fields
}
RegularInstaller uses a regular file to install an embedded binary.