plugins

package
v0.0.0-...-432de96 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, plugins []Plugin, c *Context) error

Types

type Answer

type Answer struct {
	Text   string
	Source string
}

type AnswerCurrency

type AnswerCurrency struct {
	// Endpoint is optional; defaults to the Frankfurter API.
	Endpoint string
	// Client is optional; defaults to a short-timeout http.Client.
	Client *http.Client
}

func (AnswerCurrency) Apply

func (a AnswerCurrency) Apply(ctx context.Context, c *Context) error

func (AnswerCurrency) Name

func (AnswerCurrency) Name() string

type AnswerMath

type AnswerMath struct{}

func (AnswerMath) Apply

func (AnswerMath) Apply(_ context.Context, c *Context) error

func (AnswerMath) Name

func (AnswerMath) Name() string

type AnswerRandom

type AnswerRandom struct {
	// Rand is optional; if nil a fresh PCG is used per call.
	Rand func(n int) int
}

func (AnswerRandom) Apply

func (a AnswerRandom) Apply(_ context.Context, c *Context) error

func (AnswerRandom) Name

func (AnswerRandom) Name() string

type AnswerStats

type AnswerStats struct{}

func (AnswerStats) Apply

func (AnswerStats) Apply(_ context.Context, c *Context) error

func (AnswerStats) Name

func (AnswerStats) Name() string

type AnswerUnits

type AnswerUnits struct{}

func (AnswerUnits) Apply

func (AnswerUnits) Apply(_ context.Context, c *Context) error

func (AnswerUnits) Name

func (AnswerUnits) Name() string

type BadDomains

type BadDomains struct {
	Domains []string
	Flag    string
}

func (BadDomains) Apply

func (p BadDomains) Apply(_ context.Context, c *Context) error

func (BadDomains) Name

func (BadDomains) Name() string

type Context

type Context struct {
	Query   query.Query
	Ranked  []rank.Ranked
	Infobox *Infobox
	Answer  *Answer
}

type Infobox

type Infobox struct {
	Title   string
	Summary string
	URL     string
}

type InfoboxWikipedia

type InfoboxWikipedia struct {
	Endpoint   string
	HTTPClient *http.Client
}

func (InfoboxWikipedia) Apply

func (p InfoboxWikipedia) Apply(ctx context.Context, c *Context) error

func (InfoboxWikipedia) Name

func (InfoboxWikipedia) Name() string

type Plugin

type Plugin interface {
	Name() string
	Apply(ctx context.Context, c *Context) error
}

type TrackerStrip

type TrackerStrip struct{}

func (TrackerStrip) Apply

func (TrackerStrip) Apply(_ context.Context, c *Context) error

func (TrackerStrip) Name

func (TrackerStrip) Name() string

Jump to

Keyboard shortcuts

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