plugin

package
v0.0.0-...-a92c5f4 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InterestLevel

type InterestLevel int
const (
	// Used for specific message patterns which determine interest.
	StronglyInteresting InterestLevel = iota
	// Used for specific message patterns which determine disinterest.
	StronglyUninteresting
	// Interest determined via a heuristic
	WeaklyInteresting
	// Disinterest determined via a heuristic
	WeaklyUninteresting
	UnknownInterest
)

When combining different plugins' interest categorization, we will use these rules (with order preference): 1. any( strongly interesting ) -> stronly interesting 2. not 1. and any( stronly uninteresting ) -> stronly uninteresting 3. not the above and any( weakly interesting ) -> weakly intereting 4. Not the above and any( weakly uninteresting ) -> weakly uninteresting 5. all no opinion -> no opinion

func (InterestLevel) Combine

func (i1 InterestLevel) Combine(i2 InterestLevel) InterestLevel

func (InterestLevel) InverseCombine

func (i1 InterestLevel) InverseCombine(i2 InterestLevel) InterestLevel

Favours the most uncertain answer

type MessageFilter

type MessageFilter struct {
	Desc    string
	Matches func(*gm.Message, *api.MsgHelper) bool
}

type Plugin

type Plugin struct {
	Name string

	MessageInterest           func(*gm.Message, *api.MsgHelper) InterestLevel
	DetailRequiredForInterest func() api.MessageDetailLevel

	// int64 is maxMsgs and will be -1 for unlimited
	OutdatedMessages func(string, *api.MsgHelper, int64) []*gm.Message

	PrintMessageSummary func([]*gm.Message, *api.MsgHelper)

	MessageFilters map[string]*MessageFilter
}

func LoadPlugins

func LoadPlugins() []*Plugin

type PluginBuilder

type PluginBuilder func() *Plugin

Jump to

Keyboard shortcuts

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