registry

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2025 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAs

func GetAs[T any](r *ServiceRegistry, key string) (T, error)

GetAs retrieves an external service by key and performs type assertion Returns the service as the requested type and an error if not found or type assertion fails This is a generic function that provides type-safe service retrieval Usage: service, err := registry.GetAs[*MyService](registry, "my-service-key")

Types

type ServiceRegistry

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

ServiceRegistry manages all core services and allows plugins to replace them

func NewServiceRegistry

func NewServiceRegistry() *ServiceRegistry

NewServiceRegistry creates a new service registry

func (*ServiceRegistry) APIKeyService

func (r *ServiceRegistry) APIKeyService() *apikey.Service

func (*ServiceRegistry) AppService

func (r *ServiceRegistry) AppService() *app.ServiceImpl

func (*ServiceRegistry) AuditService

func (r *ServiceRegistry) AuditService() *audit.Service

func (*ServiceRegistry) AuthService

func (r *ServiceRegistry) AuthService() auth.ServiceInterface

func (*ServiceRegistry) ConfigService

func (r *ServiceRegistry) ConfigService() *app.ServiceImpl

func (*ServiceRegistry) DeviceService

func (r *ServiceRegistry) DeviceService() *device.Service

func (*ServiceRegistry) EnvironmentService

func (r *ServiceRegistry) EnvironmentService() environment.EnvironmentService

func (*ServiceRegistry) FormsService

func (r *ServiceRegistry) FormsService() *forms.Service

func (*ServiceRegistry) Get

func (r *ServiceRegistry) Get(key string) (interface{}, bool)

Get retrieves an external service by key Returns the service and a boolean indicating if it was found The caller must perform type assertion to use the service

func (*ServiceRegistry) Has

func (r *ServiceRegistry) Has(key string) bool

Has checks if a service is registered for the given key

func (*ServiceRegistry) HasAppService

func (r *ServiceRegistry) HasAppService() bool

func (*ServiceRegistry) HasConfigService

func (r *ServiceRegistry) HasConfigService() bool

func (*ServiceRegistry) HasEnvironmentService

func (r *ServiceRegistry) HasEnvironmentService() bool

func (*ServiceRegistry) HasOrganizationService

func (r *ServiceRegistry) HasOrganizationService() bool

Utility methods for plugins

func (*ServiceRegistry) HookRegistry

func (r *ServiceRegistry) HookRegistry() *hooks.HookRegistry

Hook registry getter

func (*ServiceRegistry) IsMultiTenant

func (r *ServiceRegistry) IsMultiTenant() bool

IsMultiTenant returns true if the multi-tenancy plugin is active

func (*ServiceRegistry) JWTService

func (r *ServiceRegistry) JWTService() *jwt.Service

func (*ServiceRegistry) ListKeys

func (r *ServiceRegistry) ListKeys() []string

ListKeys returns all registered service keys

func (*ServiceRegistry) NotificationService

func (r *ServiceRegistry) NotificationService() *notification.Service

func (*ServiceRegistry) OrganizationService

func (r *ServiceRegistry) OrganizationService() *organization.Service

Plugin service getters (for multi-tenancy plugin)

func (*ServiceRegistry) RBACRegistry added in v0.0.3

func (r *ServiceRegistry) RBACRegistry() *rbac.RoleRegistry

RBAC registry getter

func (*ServiceRegistry) RBACService

func (r *ServiceRegistry) RBACService() *rbac.Service

func (*ServiceRegistry) RateLimitService

func (r *ServiceRegistry) RateLimitService() *ratelimit.Service

func (*ServiceRegistry) Register

func (r *ServiceRegistry) Register(key string, service interface{}) error

Register registers an external service by key This allows plugins and external integrations to register custom services that can be retrieved later by other plugins or components

func (*ServiceRegistry) ReplaceAPIKeyService

func (r *ServiceRegistry) ReplaceAPIKeyService(svc *apikey.Service)

func (*ServiceRegistry) ReplaceAuthService

func (r *ServiceRegistry) ReplaceAuthService(svc auth.ServiceInterface)

func (*ServiceRegistry) ReplaceFormsService

func (r *ServiceRegistry) ReplaceFormsService(svc *forms.Service)

func (*ServiceRegistry) ReplaceJWTService

func (r *ServiceRegistry) ReplaceJWTService(svc *jwt.Service)

func (*ServiceRegistry) ReplaceSessionService

func (r *ServiceRegistry) ReplaceSessionService(svc session.ServiceInterface)

func (*ServiceRegistry) ReplaceUserService

func (r *ServiceRegistry) ReplaceUserService(svc user.ServiceInterface)

ServiceImpl replacement methods (used by plugins to decorate services)

func (*ServiceRegistry) RoleRegistry

func (r *ServiceRegistry) RoleRegistry() *rbac.RoleRegistry

Role registry getter

func (*ServiceRegistry) SessionService

func (r *ServiceRegistry) SessionService() session.ServiceInterface

func (*ServiceRegistry) SetAPIKeyService

func (r *ServiceRegistry) SetAPIKeyService(svc *apikey.Service)

func (*ServiceRegistry) SetAppService

func (r *ServiceRegistry) SetAppService(svc *app.ServiceImpl)

func (*ServiceRegistry) SetAuditService

func (r *ServiceRegistry) SetAuditService(svc *audit.Service)

func (*ServiceRegistry) SetAuthService

func (r *ServiceRegistry) SetAuthService(svc auth.ServiceInterface)

func (*ServiceRegistry) SetConfigService

func (r *ServiceRegistry) SetConfigService(svc *app.ServiceImpl)

func (*ServiceRegistry) SetDeviceService

func (r *ServiceRegistry) SetDeviceService(svc *device.Service)

func (*ServiceRegistry) SetEnvironmentService

func (r *ServiceRegistry) SetEnvironmentService(svc environment.EnvironmentService)

func (*ServiceRegistry) SetFormsService

func (r *ServiceRegistry) SetFormsService(svc *forms.Service)

func (*ServiceRegistry) SetJWTService

func (r *ServiceRegistry) SetJWTService(svc *jwt.Service)

func (*ServiceRegistry) SetNotificationService

func (r *ServiceRegistry) SetNotificationService(svc *notification.Service)

func (*ServiceRegistry) SetOrganizationService

func (r *ServiceRegistry) SetOrganizationService(svc *organization.Service)

Plugin service setters (for multi-tenancy plugin)

func (*ServiceRegistry) SetRBACService

func (r *ServiceRegistry) SetRBACService(svc *rbac.Service)

func (*ServiceRegistry) SetRateLimitService

func (r *ServiceRegistry) SetRateLimitService(svc *ratelimit.Service)

func (*ServiceRegistry) SetSessionService

func (r *ServiceRegistry) SetSessionService(svc session.ServiceInterface)

func (*ServiceRegistry) SetUserService

func (r *ServiceRegistry) SetUserService(svc user.ServiceInterface)

Core service setters (used during initialization)

func (*ServiceRegistry) SetWebhookService

func (r *ServiceRegistry) SetWebhookService(svc *webhook.Service)

func (*ServiceRegistry) Unregister

func (r *ServiceRegistry) Unregister(key string) error

Unregister removes a service from the registry by key

func (*ServiceRegistry) UserService

func (r *ServiceRegistry) UserService() user.ServiceInterface

Core service getters

func (*ServiceRegistry) WebhookService

func (r *ServiceRegistry) WebhookService() *webhook.Service

Jump to

Keyboard shortcuts

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