In Development Package, API may change between versions.

import "github.com/egdaemon/eg/runtime/x/wasi/egbug"

Package egbug is an internal package and not under the compatiability promises of EG. its used for debugging and analysis.

Constants

const (
    EnvUnsafeDigest = "EG_UNSAFE_ENVVARS_DIGEST"
)

const (
    ErrUnexpectedSuccessfulOperation = errorsx.String("expected an error but operation succeeded")
)

func APTPackage

func APTPackage(packages ...string) eg.OpFn

prints information about the provided apt packages using dpkg and apt.

func CachedID

func CachedID() string

func DebugFailure

func DebugFailure(op, debug eg.OpFn) eg.OpFn

Utility operation for debugging failures

func Depth

func Depth() int

func DirectoryTree

func DirectoryTree(dir string) eg.OpFn

prints the directory tree of the provided path.

func EgEnviron

func EgEnviron() []string

func EnsureEnv

func EnsureEnv(expected string, keys ...string) eg.OpFn

func EnsureEnvAuto

func EnsureEnvAuto(ctx context.Context, op eg.Op) error

Ensures the environment is stable between releases. only usable for standard compute. baremetal is too variable. use EnsureEnvSubset for baremetal.

func Env

func Env(ctx context.Context, op eg.Op) error

prints current environment variables.

func ExpectedFailure

func ExpectedFailure(op eg.OpFn, allowed ...error) eg.OpFn

for commands we want to fail in a particular manner. useful for tests.

func Fail

func Fail(ctx context.Context, op eg.Op) error

func FileTree

func FileTree(ctx context.Context, op eg.Op) error

prints debugging information about the environment workspaces.

func Images

func Images(ctx context.Context, op eg.Op) error

func Log

func Log(m ...any) eg.OpFn

func Module

func Module(ctx context.Context, op eg.Op) error

prints debugging information about the currently executing module.

func Must

func Must[T any](v T, err error) T

func Sleep

func Sleep(d time.Duration) eg.OpFn

utility function for prototyping.

func SystemInit

func SystemInit(ctx context.Context, op eg.Op) error

debugging information for system initialization

func Users

func Users(ctx context.Context, op eg.Op) error

prints debugging information about the current user.

func Zero

func Zero[T any](v T, err error) T