plugin

package
v0.1.16 Latest Latest
Warning

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

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

Documentation

Overview

Package plugin provides the Plugin SDK that plugin authors import. A plugin implements the Plugin interface and calls Run(impl) from main().

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(impl Plugin)

Run is the entry point called from a plugin's main(). It handles all infrastructure: flag parsing, NATS connection, health check subscription, signal handling, and teardown.

Types

type Clients

type Clients interface {
	Game() *game.Client
	Entity() *entity.Client
	Tile() *tile.Client
	Surface() *surface.Client
	Resource() *resource.Client
	Player() *player.Client
	PlayerAttr() *playerattr.Client
}

Clients provides lazily-initialized typed client accessors.

type Context

type Context interface {
	Rcon(command string) (string, error)
	Subscribe(subject string, handler func([]byte)) error
	Publish(subject string, data []byte) error
	DataDir() string
	Logger() *slog.Logger
	Done() <-chan struct{}
	Clients() Clients
}

Context provides plugin access to factop infrastructure.

type Plugin

type Plugin interface {
	Setup(ctx Context) error
	Run(ctx Context) error
}

Plugin is the interface that plugin authors implement.

Jump to

Keyboard shortcuts

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