extensions

package
v0.0.46 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SandboxTypeNone = process.SandboxTypeNone
	SandboxTypeShai = process.SandboxTypeShai
)
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 IsSelector

func IsSelector(selector string) bool

func NormalizeGitRepositorySourceForSelector added in v0.0.35

func NormalizeGitRepositorySourceForSelector(source string) (string, error)

Types

type ExecutionInput

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

type ExtensionOpSpec

type ExtensionOpSpec struct {
	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 {
	Selector         string
	ResolvedSelector string
	ResolvedCommit   string
	ProjectRoot      string
	OpDir            string
	SpecPath         string
	Spec             ExtensionOpSpec
	// contains filtered or unexported fields
}

func Resolve

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

func (*ResolvedOp) ApplyInvocationDefaults

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

func (*ResolvedOp) SanitizeInvocationInputs

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

func (*ResolvedOp) ValidateInvocationInputs

func (r *ResolvedOp) ValidateInvocationInputs(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

type SandboxInput

type SandboxInput = process.SandboxInput

func ParseSandboxInput

func ParseSandboxInput(raw interface{}) (*SandboxInput, error)

type SandboxPathConfig added in v0.0.8

type SandboxPathConfig = process.SandboxPathConfig

type SandboxPathMapping added in v0.0.8

type SandboxPathMapping = process.SandboxPathMapping

Jump to

Keyboard shortcuts

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