addon

package
v0.25.0 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

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, desc string, ro bool, vfunc options.ValueValidator) options.Spec

Types

type Addon

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

func New

func New(c Config, opts ...options.Spec) *Addon

func (*Addon) Emits

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

func (*Addon) OnRegister

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

func (*Addon) ProvideAPI

func (addon *Addon) ProvideAPI(api custom.API)

func (*Addon) ProvideCommand

func (addon *Addon) ProvideCommand(cmd *command.Command)

func (*Addon) ProvideService

func (addon *Addon) ProvideService(svc *services.Service)

type Config

type Config struct {
	Name string
	// DiscardEvents tells application to discard all events this addon emits
	DiscardEvents   bool
	WithoutCommands bool
	WithoutServices bool
	Settings        settings.Settings
}

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.Options) error

func (*Manager) ExtendSettings

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

func (*Manager) GetAPIs

func (m *Manager) GetAPIs() map[string]custom.API

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