import "github.com/egdaemon/eg/runtime/wasi/egunsafe"

Package provides some internal only functionality not under compatability promises.

func DialAnalyticsSocket

func DialAnalyticsSocket(ctx context.Context, network, addr string) (net.Conn, error)

DialAnalyticsSocket dials the analytics (duckproxy) socket, for issuing SQL against the host's analytics.db. Signature matches duckproxy.DialFunc.

func DialControlSocket

func DialControlSocket(ctx context.Context) (conn *grpc.ClientConn, err error)

dial the control socket for executing various functionality that is too slow or impedes concurrency.

func DialModuleControlSocket

func DialModuleControlSocket(ctx context.Context) (conn *grpc.ClientConn, err error)

dial the control socket for modules.

func HostPrefixes

func HostPrefixes() []netip.Prefix

resolve the netip.Prefixes of the host. returns a slice containing only the unroutable prefix on error.

func ModuleRuntimeDirectory

func ModuleRuntimeDirectory(id uuid.UUID) string

ModuleRuntimeDirectory is the name of the directory of a workload run, named after the last 4 bytes of the run id, the random part of a v7 uuid. the name is kept short as the sockets within the run's directory are close to the length limit of a unix socket path.

func PatternIsolate

func PatternIsolate(n int, pattern string) string

create an string from the given pattern that contains a short (n) length random sequence from a uuidv7. used to create isolated directories like proc/module runtime.

func PatternIsolateFrom

func PatternIsolateFrom(id uuid.UUID, n int, pattern string) string

create an string from the given pattern that contains the last n bytes of the provided id. %x encodes as hex, %s as unpadded url safe base64, a precision of 16, 32, 64 selects hex, lowercase base32, base64 respectively for either verb.

func RuntimeDirectory

func RuntimeDirectory(paths ...string) string

RuntimeDirectory returns the absolute path to the runtime directory, joined with paths when provided. the runner controls the location through the environment, the default mount is only used when it is unset.

func UnroutablePrefix

func UnroutablePrefix() netip.Prefix
⬤