extensions

package
v0.0.69 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const ExecutionOpType = "extension_execution"

Variables

This section is empty.

Functions

func ExecuteProcess

func ExecuteProcess(ctx context.Context, req RunRequest) ([]byte, []byte, error)

func GetExecutionOp

func GetExecutionOp() ops.RegisterableOp

func GitSelectorRepoRefKey added in v0.0.35

func GitSelectorRepoRefKey(selector string) (string, bool, error)

func IsLocalSelector

func IsLocalSelector(selector string) bool

func IsNixSelector added in v0.0.64

func IsNixSelector(selector string) bool

func IsSelector

func IsSelector(selector string) bool

func NormalizeGitRepositorySourceForSelector added in v0.0.35

func NormalizeGitRepositorySourceForSelector(source string) (string, error)

func WithPreparedOp added in v0.0.64

func WithPreparedOp(ctx context.Context, op *ResolvedOp) context.Context

WithPreparedOp supplies a manifest/source prepared before the task deadline.

Types

type ExecutionInput

type ExecutionInput struct {
	Env              map[string]string      `json:"env,omitempty" secret:"env"`
	Selector         string                 `json:"selector" validate:"required"`
	Inputs           map[string]interface{} `json:"inputs,omitempty" secret:"schema"`
	RepositorySource string                 `json:"repository_source,omitempty"`
	RepositoryRef    string                 `json:"repository_ref,omitempty"`
}

type ExtensionOpSpec

type ExtensionOpSpec struct {
	Dependencies []string          `yaml:"dependencies,omitempty" json:"dependencies,omitempty"`
	Name         string            `yaml:"name"`
	Description  string            `yaml:"description"`
	Version      string            `yaml:"version"`
	Shell        string            `yaml:"shell"`
	Run          string            `yaml:"run"`
	Command      []string          `yaml:"command"`
	Env          map[string]string `yaml:"env"`
	Timeout      string            `yaml:"timeout"`
	InputSchema  map[string]any    `yaml:"input_schema"`
	OutputSchema map[string]any    `yaml:"output_schema"`
}

ExtensionOpSpec models the op.yaml configuration for a selector-resolved extension op.

type InputDefaults

type InputDefaults struct {
	// contains filtered or unexported fields
}

InputDefaults applies schema-backed defaults to extension-op invocation inputs.

func BuildInputDefaults

func BuildInputDefaults(raw map[string]any, compiled *jsonschemav6.Schema) (*InputDefaults, error)

func (*InputDefaults) Apply

func (d *InputDefaults) Apply(input map[string]interface{}) (bool, error)

type ResolveOptions

type ResolveOptions struct {
	BaseDir          string
	RepositorySource string
	RepositoryRef    string
	ResolvedRefs     map[string]string
}

type ResolvedOp

type ResolvedOp struct {
	Nix              *toolenv.NixPackage `json:",omitempty"`
	NixRoot          string              `json:",omitempty"`
	Selector         string
	ResolvedSelector string
	ResolvedCommit   string
	ProjectRoot      string
	OpDir            string
	SpecPath         string
	Spec             ExtensionOpSpec
	// contains filtered or unexported fields
}

func PrepareNixOp added in v0.0.64

func PrepareNixOp(ctx context.Context, r *ResolvedOp) (*ResolvedOp, bool, error)

PrepareNixOp downloads the output pinned during description, then checks that its installed manifest matches the one used for validation and defaults.

func Resolve

func Resolve(ctx context.Context, selector string, opts ResolveOptions) (*ResolvedOp, error)

func RestoreResolvedOp added in v0.0.64

func RestoreResolvedOp(resolved *ResolvedOp) (*ResolvedOp, error)

RestoreResolvedOp reconstructs validators from a durable manifest without source I/O.

func (*ResolvedOp) ApplyInvocationDefaults

func (r *ResolvedOp) ApplyInvocationDefaults(raw map[string]interface{}) (bool, error)

func (*ResolvedOp) Ready added in v0.0.64

func (r *ResolvedOp) Ready() bool

Ready performs only local checks. Payload recovery belongs to the setup task.

func (*ResolvedOp) ValidateInvocationInputs

func (r *ResolvedOp) ValidateInvocationInputs(raw map[string]interface{}) error

func (*ResolvedOp) ValidateMaterializedInputs added in v0.0.66

func (r *ResolvedOp) ValidateMaterializedInputs(raw map[string]interface{}) error

func (*ResolvedOp) WorkingDir

func (r *ResolvedOp) WorkingDir() string

func (*ResolvedOp) ZeroOutput

func (r *ResolvedOp) ZeroOutput() map[string]interface{}

type ResolvedSelectorPath

type ResolvedSelectorPath struct {
	Selector         string
	ResolvedSelector string
	ResolvedCommit   string
	ProjectRoot      string
	Dir              string
}

func ResolvePath

func ResolvePath(ctx context.Context, selector string, opts ResolveOptions) (*ResolvedSelectorPath, error)

type RunRequest

type RunRequest = process.RunRequest

Jump to

Keyboard shortcuts

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