source

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package source resolves an authorized extension path into one conventional factory or exact isolated standalone definition.

Index

Constants

View Source
const GoSDKModulePath = "github.com/MichaelKinsy/PiG/extensions/sdk"

GoSDKModulePath is the Go SDK module path that current Pig scaffolds import.

View Source
const LegacyGoSDKModulePath = "github.com/mainstai/pig/extensions/sdk"

LegacyGoSDKModulePath is the module path the same Go SDK carried in Pig 0.84 and earlier. Factories written against it stay loadable: generated runners alias it to the current SDK source, so the extension compiles against the SDK that speaks the running host's protocol.

Variables

This section is empty.

Functions

func IsGoSDKModulePath

func IsGoSDKModulePath(path string) bool

IsGoSDKModulePath reports whether path names the Go SDK module under its current or legacy module path.

Types

type Definition

type Definition struct {
	Language           string
	Form               Form
	Root               string
	Entrypoint         string
	ModulePath         string
	Package            string
	Factory            string
	Packable           bool
	GoWorkspaceModules []string
	// SDKModulePath is the Go SDK module path a Go factory imports.
	SDKModulePath string
}

Definition is the complete runtime input derived from one authorized source.

func Resolve

func Resolve(input string) (Definition, error)

Resolve classifies one exact source path without reading any extension metadata file.

type Form

type Form string

Form is one supported author-facing extension execution form.

const (
	// Factory is a conventional language factory hosted by a generated runner.
	Factory Form = "factory"
	// Standalone is an exact isolated executable or executable source.
	Standalone Form = "standalone"
)

type ResolveFunc

type ResolveFunc func(string) (Definition, error)

ResolveFunc classifies one exact extension source path. Callers that own a bounded resolution snapshot use it to share one source scan across startup validation, discovery, trust, and loading.

Jump to

Keyboard shortcuts

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