addon

package
v0.305.0 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2025 License: Apache-2.0 Imports: 21 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidAddonName = fmt.Errorf("%s: invalid addon name", Error)
)
View Source
var (
	Error = errors.New("addon")
)

Functions

func Option

func Option(key string, dval any) *options.OptionSpec

Types

type Addon

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

func New

func New(name string) *Addon

func (*Addon) Deprecated added in v0.100.0

func (addon *Addon) Deprecated(msg string) *Addon

Deprecated allows developers to mark an addon or some of its as deprecated.

func (*Addon) OnRegister

func (addon *Addon) OnRegister(action action.Register) *Addon

func (*Addon) ProvideAPI

func (addon *Addon) ProvideAPI(api api.Provider) *Addon

func (*Addon) ProvideCommands added in v0.26.0

func (addon *Addon) ProvideCommands(cmds ...*command.Command) *Addon

func (*Addon) ProvideServices added in v0.26.0

func (addon *Addon) ProvideServices(svcs ...*services.Service) *Addon

func (*Addon) WithConfig added in v0.100.0

func (addon *Addon) WithConfig(cfg Config) *Addon

func (*Addon) WithEvents added in v0.100.0

func (addon *Addon) WithEvents(evs ...events.Event) *Addon

func (*Addon) WithOptions added in v0.100.0

func (addon *Addon) WithOptions(opts ...*options.OptionSpec) *Addon

func (*Addon) WithSettings added in v0.100.0

func (addon *Addon) WithSettings(s settings.Settings) *Addon

type Config

type Config struct {
	// Slug is the unique identifier for this addon.
	Slug string
	// DiscardEvents tells application to discard all events this addon emits.
	DiscardEvents bool
	// WithoutCommands tells application to discard all commands this addon registers.
	WithoutCommands bool
	// WithoutServices tells application to discard all services this addon registers.
	WithoutServices bool
}

type Info

type Info struct {
	Name        string
	Slug        string
	Description string
	Version     version.Version
	Module      string
}

type Manager

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

func NewManager

func NewManager() *Manager

func (*Manager) Add

func (m *Manager) Add(addon *Addon) error

func (*Manager) Commands

func (m *Manager) Commands() []*command.Command

func (*Manager) Events

func (m *Manager) Events() []events.Event

func (*Manager) ExtendOptions

func (m *Manager) ExtendOptions(opts *options.Spec) error

func (*Manager) ExtendSettings

func (m *Manager) ExtendSettings(sb *settings.Blueprint) error

func (*Manager) GetAPIs

func (m *Manager) GetAPIs() map[string]api.Provider

func (*Manager) Register

func (m *Manager) Register(sess session.Register) error

func (*Manager) Services

func (m *Manager) Services() []*services.Service

Jump to

Keyboard shortcuts

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