registry

package
v0.0.0-...-d88c8eb Latest Latest
Warning

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

Go to latest
Published: May 6, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package registry holds plugin factories and instantiates plugin instances from stored JSON configuration. Built-in plugins self-register via init().

Index

Constants

This section is empty.

Variables

View Source
var Default = New()

Default is the application-wide plugin registry. Built-in plugins register themselves here in their init() functions.

Functions

This section is empty.

Types

type DownloaderFactory

type DownloaderFactory func(settings json.RawMessage) (plugin.DownloadClient, error)

DownloaderFactory constructs a DownloadClient from a JSON settings blob.

type ImportListFactory

type ImportListFactory func(settings json.RawMessage) (plugin.ImportList, error)

ImportListFactory constructs an ImportList from a JSON settings blob.

type IndexerFactory

type IndexerFactory func(settings json.RawMessage) (plugin.Indexer, error)

IndexerFactory constructs an Indexer from a JSON settings blob.

type MediaServerFactory

type MediaServerFactory func(settings json.RawMessage) (plugin.MediaServer, error)

MediaServerFactory constructs a MediaServer from a JSON settings blob.

type NotifierFactory

type NotifierFactory func(settings json.RawMessage) (plugin.Notifier, error)

NotifierFactory constructs a Notifier from a JSON settings blob.

type Registry

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

Registry maps plugin kind strings to their factory functions. Use Default for the application-wide singleton.

func New

func New() *Registry

New returns an empty, ready-to-use Registry.

func (*Registry) DownloaderKinds

func (r *Registry) DownloaderKinds() []string

DownloaderKinds returns the list of registered downloader kind strings.

func (*Registry) ImportListKinds

func (r *Registry) ImportListKinds() []string

ImportListKinds returns the list of registered import list kind strings.

func (*Registry) IndexerKinds

func (r *Registry) IndexerKinds() []string

IndexerKinds returns the list of registered indexer kind strings.

func (*Registry) MediaServerKinds

func (r *Registry) MediaServerKinds() []string

MediaServerKinds returns the list of registered media server kind strings.

func (*Registry) NewDownloader

func (r *Registry) NewDownloader(kind string, settings json.RawMessage) (plugin.DownloadClient, error)

NewDownloader constructs a DownloadClient from the given kind and JSON settings. Returns an error if the kind is unknown or settings are invalid.

func (*Registry) NewImportList

func (r *Registry) NewImportList(kind string, settings json.RawMessage) (plugin.ImportList, error)

NewImportList constructs an ImportList from the given kind and JSON settings. Returns an error if the kind is unknown or settings are invalid.

func (*Registry) NewIndexer

func (r *Registry) NewIndexer(kind string, settings json.RawMessage) (plugin.Indexer, error)

NewIndexer constructs an Indexer from the given kind and JSON settings. Returns an error if the kind is unknown or settings are invalid.

func (*Registry) NewMediaServer

func (r *Registry) NewMediaServer(kind string, settings json.RawMessage) (plugin.MediaServer, error)

NewMediaServer constructs a MediaServer from the given kind and JSON settings. Returns an error if the kind is unknown or settings are invalid.

func (*Registry) NewNotifier

func (r *Registry) NewNotifier(kind string, settings json.RawMessage) (plugin.Notifier, error)

NewNotifier constructs a Notifier from the given kind and JSON settings. Returns an error if the kind is unknown or settings are invalid.

func (*Registry) NotifierKinds

func (r *Registry) NotifierKinds() []string

NotifierKinds returns the list of registered notifier kind strings.

func (*Registry) RegisterDownloader

func (r *Registry) RegisterDownloader(kind string, factory DownloaderFactory)

RegisterDownloader adds a factory for the given download client kind string. Panics if kind is already registered (caught at startup, not runtime).

func (*Registry) RegisterDownloaderSanitizer

func (r *Registry) RegisterDownloaderSanitizer(kind string, fn SanitizerFunc)

RegisterDownloaderSanitizer registers a settings sanitizer for the given download client kind.

func (*Registry) RegisterImportList

func (r *Registry) RegisterImportList(kind string, factory ImportListFactory)

RegisterImportList adds a factory for the given import list kind string. Panics if kind is already registered (caught at startup, not runtime).

func (*Registry) RegisterImportListSanitizer

func (r *Registry) RegisterImportListSanitizer(kind string, fn SanitizerFunc)

RegisterImportListSanitizer registers a settings sanitizer for the given import list kind.

func (*Registry) RegisterIndexer

func (r *Registry) RegisterIndexer(kind string, factory IndexerFactory)

RegisterIndexer adds a factory for the given kind string. Panics if kind is already registered (caught at startup, not runtime).

func (*Registry) RegisterIndexerSanitizer

func (r *Registry) RegisterIndexerSanitizer(kind string, fn SanitizerFunc)

RegisterIndexerSanitizer registers a settings sanitizer for the given indexer kind. Call this from the same init() as RegisterIndexer.

func (*Registry) RegisterMediaServer

func (r *Registry) RegisterMediaServer(kind string, factory MediaServerFactory)

RegisterMediaServer adds a factory for the given media server kind string. Panics if kind is already registered (caught at startup, not runtime).

func (*Registry) RegisterMediaServerSanitizer

func (r *Registry) RegisterMediaServerSanitizer(kind string, fn SanitizerFunc)

RegisterMediaServerSanitizer registers a settings sanitizer for the given media server kind.

func (*Registry) RegisterNotifier

func (r *Registry) RegisterNotifier(kind string, factory NotifierFactory)

RegisterNotifier adds a factory for the given notifier kind string. Panics if kind is already registered (caught at startup, not runtime).

func (*Registry) RegisterNotifierSanitizer

func (r *Registry) RegisterNotifierSanitizer(kind string, fn SanitizerFunc)

RegisterNotifierSanitizer registers a settings sanitizer for the given notifier kind.

func (*Registry) SanitizeDownloaderSettings

func (r *Registry) SanitizeDownloaderSettings(kind string, settings json.RawMessage) json.RawMessage

SanitizeDownloaderSettings returns a redacted copy of the settings blob safe for API responses and logs. Falls back to "{}" if no sanitizer is registered.

func (*Registry) SanitizeImportListSettings

func (r *Registry) SanitizeImportListSettings(kind string, settings json.RawMessage) json.RawMessage

SanitizeImportListSettings returns a redacted copy of the settings blob safe for API responses and logs. Falls back to "{}" if no sanitizer is registered.

func (*Registry) SanitizeIndexerSettings

func (r *Registry) SanitizeIndexerSettings(kind string, settings json.RawMessage) json.RawMessage

SanitizeIndexerSettings returns a redacted copy of the settings blob safe for API responses and logs. Falls back to "{}" if no sanitizer is registered.

func (*Registry) SanitizeMediaServerSettings

func (r *Registry) SanitizeMediaServerSettings(kind string, settings json.RawMessage) json.RawMessage

SanitizeMediaServerSettings returns a redacted copy of the settings blob safe for API responses and logs. Falls back to "{}" if no sanitizer is registered.

func (*Registry) SanitizeNotifierSettings

func (r *Registry) SanitizeNotifierSettings(kind string, settings json.RawMessage) json.RawMessage

SanitizeNotifierSettings returns a redacted copy of the settings blob safe for API responses and logs. Falls back to "{}" if no sanitizer is registered.

type SanitizerFunc

type SanitizerFunc func(settings json.RawMessage) json.RawMessage

SanitizerFunc redacts sensitive fields from a plugin settings blob so it is safe to include in API responses and logs. It must never return nil. Plugins register one via RegisterIndexerSanitizer / RegisterDownloaderSanitizer / RegisterNotifierSanitizer. If no sanitizer is registered the registry falls back to returning an empty JSON object so credentials are never exposed.

Jump to

Keyboard shortcuts

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