registry

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2026 License: Apache-2.0 Imports: 19 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) (any, 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

HasOrganizationService checks if the organization service is available.

func (*ServiceRegistry) HookRegistry

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

HookRegistry returns the hook registry.

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

OrganizationService returns the organization service.

func (*ServiceRegistry) RBACRegistry added in v0.0.3

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

RBACRegistry returns the RBAC role registry.

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 any) 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)

ReplaceUserService replaces the user service (used by plugins to decorate services).

func (*ServiceRegistry) RoleRegistry

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

RoleRegistry returns the role registry.

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)

SetOrganizationService sets the organization service.

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)

SetUserService sets the user service.

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

UserService returns the user service.

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