wire

package
v0.0.0-...-ef92b72 Latest Latest
Warning

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

Go to latest
Published: May 9, 2026 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package wire holds the value types shared between the public engine package and internal subsystems (plugin, runner). Engine re-exports each type as an alias so the public API surface is unchanged.

The package exists solely to break the would-be import cycle:

engine ⇄ internal/{plugin,runner}

Subsystems import wire; engine imports both wire and the subsystems.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventSpec

type EventSpec struct {
	Description string               `json:"description"`
	Fields      map[string]FieldSpec `json:"fields"`
}

EventSpec describes a single event a plugin can emit at runtime.

type FieldSpec

type FieldSpec struct {
	Type        FieldType `json:"type"`
	Required    bool      `json:"required"`
	Description string    `json:"description"`
}

FieldSpec describes one field in a plugin contract.

type FieldType

type FieldType string

FieldType enumerates the YAML/JSON types a plugin field may hold.

const (
	FieldString FieldType = "string"
	FieldNumber FieldType = "number"
	FieldBool   FieldType = "bool"
	FieldObject FieldType = "object"
	FieldArray  FieldType = "array"
	FieldMap    FieldType = "map"
	FieldAny    FieldType = "any"
)

type PluginEvent

type PluginEvent struct {
	Plugin string         `json:"plugin"`
	Kind   string         `json:"kind"`
	Data   map[string]any `json:"data,omitempty"`
}

PluginEvent is the universal wrapper for events emitted by plugins.

func (PluginEvent) FullName

func (e PluginEvent) FullName() string

FullName returns the fully-qualified event name "<plugin>.<kind>".

type PluginSchema

type PluginSchema struct {
	Name         string               `json:"name"`
	Version      string               `json:"version"`
	Description  string               `json:"description"`
	Protocols    []Protocol           `json:"protocols"`
	Capabilities []string             `json:"capabilities,omitempty"`
	Fields       map[string]FieldSpec `json:"fields,omitempty"`
	Events       map[string]EventSpec `json:"events,omitempty"`
}

PluginSchema is the public introspection shape for a loaded plugin.

type Protocol

type Protocol string

Protocol identifies a target protocol, derived from the target URL scheme or declared explicitly by a plugin.

const (
	ProtocolHTTP    Protocol = "http"
	ProtocolHTTPS   Protocol = "https"
	ProtocolGRPC    Protocol = "grpc"
	ProtocolGRPCS   Protocol = "grpcs"
	ProtocolWS      Protocol = "ws"
	ProtocolWSS     Protocol = "wss"
	ProtocolGraphQL Protocol = "graphql"
	ProtocolSQL     Protocol = "sql"
	ProtocolKafka   Protocol = "kafka"
	ProtocolAMQP    Protocol = "amqp"
	ProtocolRedis   Protocol = "redis"
)

func (Protocol) String

func (p Protocol) String() string

String returns the protocol as a plain string.

type Severity

type Severity string

Severity classifies the importance of a validation issue.

const (
	SeverityError   Severity = "error"
	SeverityWarning Severity = "warning"
)

type Signal

type Signal int

Signal is a control command from frontend to engine.

const (
	SignalPause Signal = iota
	SignalResume
	SignalSkipTest
)

func (Signal) String

func (s Signal) String() string

String returns the canonical signal name.

type TestStatus

type TestStatus int

TestStatus represents the outcome of a test case.

const (
	StatusPassed TestStatus = iota
	StatusFailed
	StatusSkipped
	StatusErrored
)

func (TestStatus) String

func (s TestStatus) String() string

String returns the canonical name for a status.

type ValidationError

type ValidationError struct {
	File     string   `json:"file"`
	Line     int      `json:"line,omitempty"`
	Field    string   `json:"field,omitempty"`
	Message  string   `json:"message"`
	Severity Severity `json:"severity"`
}

ValidationError describes a problem found during manifest validation.

Jump to

Keyboard shortcuts

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