execimage

package
v0.0.0-...-90deddd Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoEmbeddedImage = errors.New("no embedded linux image")

ErrNoEmbeddedImage is thrown if the current binary has no embedded linux image.

Functions

func DigestAndSize

func DigestAndSize(r io.Reader) (digest.Digest, int64, error)

DigestAndSize returns the digest and size of the given Reader.

func EmbeddedLinuxImage

func EmbeddedLinuxImage() (io.ReadCloser, error)

EmbeddedLinuxImage returns a reader pointing to an embedded linux image with the following assumptions: - if the current GOOS is linux, returns the current binary. - if the current GOOS is darwin, and current binary size is larger than what Mach-O reports, returns a reader to the current binary offset by the size of the darwin binary. - returns ErrNoEmbeddedImage if

  • if the current GOOS is not darwin
  • if the current GOOS is darwin, but there's no embedding.

func ExecPath

func ExecPath() (string, error)

ExecPath returns an absolute path to the executable of the current running process.

Types

This section is empty.

Jump to

Keyboard shortcuts

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