dangshared

package
v0.21.5 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 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, *engine.ClientMetadata, error)

NewNestedClientMetadata returns the caller's client metadata along with fresh metadata for a nested client to evaluate Dang code under.

func WithNestedClientServer

func WithNestedClientServer(
	ctx context.Context,
	query *core.Query,
	nestedClientMetadata *engine.ClientMetadata,
	callerClientID string,
	hostServiceProxyToCaller bool,
	fnCall *core.FunctionCall,
	moduleContext dagql.ObjectResult[*core.Module],
	envContext dagql.ObjectResult[*core.Env],
	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.

Types

This section is empty.

Jump to

Keyboard shortcuts

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