dangshared

package
v1.0.0-beta.15 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package dangshared holds the Dang-version-agnostic plumbing shared by every supported major version of the Dang runtime (core/sdk/dang/v1, v2, ...).

Nothing in this package may import github.com/vito/dang (any major); that keeps the per-version packages free to be pure copies of each other with only their dang import paths rewritten. See core/sdk/dang/README.md.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertError

func ConvertError(rerr error) *core.Error

ConvertError converts an error from Dang evaluation into a *core.Error, preserving GraphQL error extensions as error values.

func NewNestedClientMetadata

func NewNestedClientMetadata(ctx context.Context) (*engine.ClientMetadata, error)

NewNestedClientMetadata returns fresh metadata for a nested client to evaluate Dang code under, in the caller's session.

func WithNestedClientServer

func WithNestedClientServer(
	ctx context.Context,
	query *core.Query,
	nestedClientMetadata *engine.ClientMetadata,
	inertAttachables bool,
	fnCall *core.FunctionCall,
	moduleContext dagql.ObjectResult[*core.Module],
	fn func(ctx context.Context, gqlClient graphql.Client) ([]byte, error),
) ([]byte, error)

WithNestedClientServer serves the Dagger API for a nested client on a local listener and calls fn with a GraphQL client pointed at it. The server is shut down when fn returns; any error it hit while serving is returned. In-engine SDK clients pass inertAttachables to reject implicit access to the caller's host while still allowing graph values explicitly passed to them.

The nested client's parent is the client whose scope ctx holds, exactly as for container execs: workspace operations run under a scope other than the client their request metadata names, and the session only accepts a child registered by its held parent scope.

Types

This section is empty.

Jump to

Keyboard shortcuts

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