Help us shape the future of Go! Take the 2026 Go Developer Survey

meta

package
v0.3.8 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsMeta

func IsMeta(input string) bool

IsMeta returns true if the input starts with ':'.

Types

type CommandHandler

type CommandHandler func(ctx context.Context, args []string) (string, error)

CommandHandler is a function that handles a meta command.

type CommandResult added in v0.1.2

type CommandResult struct {
	Text string // Plain text output
	HTML string // HTML output (if non-empty, sent as text/html)
}

CommandResult holds the output of a meta command with optional MIME type.

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

Registry holds registered meta commands.

func NewRegistry

func NewRegistry(eng *engine.Engine, setLimit func(int), sp *spool.Spool) *Registry

NewRegistry creates a new command registry with default commands.

func (*Registry) Dispatch

func (r *Registry) Dispatch(ctx context.Context, input string) (*CommandResult, error)

Dispatch parses and executes a meta command, returning a CommandResult.

func (*Registry) Register

func (r *Registry) Register(name, description string, handler CommandHandler)

Register adds a command to the registry.

func (*Registry) RegisterRich added in v0.1.2

func (r *Registry) RegisterRich(name, description string, handler RichCommandHandler)

RegisterRich adds a rich command (with HTML support) to the registry.

type RichCommandHandler added in v0.1.2

type RichCommandHandler func(ctx context.Context, args []string) (*CommandResult, error)

RichCommandHandler returns a CommandResult with optional HTML output.

Jump to

Keyboard shortcuts

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