plugin

package
v0.0.0-...-1d67dc5 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package plugin defines the interface and registry for interpretation plugins. Plugins are compiled as .so files and loaded at runtime via the --plugin-dir flag.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadDir

func LoadDir(dir string) (int, error)

LoadDir loads all .so plugins from a directory. Plugins must export a symbol "Plugin" of type Interpreter. NOTE: Go's plugin package only works on Linux with CGO_ENABLED=1. On other platforms, LoadDir returns 0, nil (no error — just no plugins loaded).

func Register

func Register(p Interpreter)

Register adds a plugin to the global registry.

Types

type Interpreter

type Interpreter interface {
	// Name returns the plugin's unique identifier.
	Name() string
	// Version returns the plugin's semantic version.
	Version() string
	// Description returns a human-readable description.
	Description() string
	// PlanetInSign returns an interpretation for a planet in a sign.
	// Returns empty string if this plugin doesn't cover this combination.
	PlanetInSign(planet, sign string) string
	// AspectInterpretation returns an interpretation for an aspect between two planets.
	AspectInterpretation(p1, p2, aspectType string, orb float64) string
	// HousePlacement returns an interpretation for a planet in a house.
	HousePlacement(planet string, house int) string
}

Interpreter is the interface for interpretation plugins. Each plugin provides interpretations for a specific domain (e.g., planet-in-sign, aspect, house placement).

func Get

func Get(name string) (Interpreter, bool)

Get returns a plugin by name.

func List

func List() []Interpreter

List returns all registered plugins.

Jump to

Keyboard shortcuts

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