Documentation
¶
Index ¶
- type AppsListResponse
- type Config
- type MembersListResponse
- type MultitenancyErrorResponse
- type MultitenancyStatusResponse
- type Plugin
- func (p *Plugin) ID() string
- func (p *Plugin) Init(authInstance core.Authsome) error
- func (p *Plugin) Migrate() error
- func (p *Plugin) RegisterHooks(hooks *hooks.HookRegistry) error
- func (p *Plugin) RegisterRoutes(router forge.Router) error
- func (p *Plugin) RegisterServiceDecorators(services *registry.ServiceRegistry) error
- type PluginOption
- func WithDefaultAppName(name string) PluginOption
- func WithDefaultConfig(cfg Config) PluginOption
- func WithEnableAppCreation(enabled bool) PluginOption
- func WithInvitationExpiryHours(hours int) PluginOption
- func WithMaxMembersPerApp(max int) PluginOption
- func WithMaxTeamsPerApp(max int) PluginOption
- func WithPlatformAppID(id xid.ID) PluginOption
- func WithRequireInvitation(required bool) PluginOption
- type TeamsListResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// PlatformAppID is the ID of the platform app
PlatformAppID xid.ID `json:"platformAppId"`
// DefaultAppName is the name of the default app in standalone mode
DefaultAppName string `json:"defaultAppName"`
// EnableAppCreation allows users to create new apps (multitenancy mode)
EnableAppCreation bool `json:"enableAppCreation"`
// MaxMembersPerApp limits the number of members per app
MaxMembersPerApp int `json:"maxMembersPerApp"`
// MaxTeamsPerApp limits the number of teams per app
MaxTeamsPerApp int `json:"maxTeamsPerApp"`
// RequireInvitation requires invitation for joining apps
RequireInvitation bool `json:"requireInvitation"`
// InvitationExpiryHours sets how long invitations are valid
InvitationExpiryHours int `json:"invitationExpiryHours"`
// AutoCreateDefaultApp auto-creates default app on server start
AutoCreateDefaultApp bool `json:"autoCreateDefaultApp"`
// DefaultEnvironmentName is the name of the default dev environment
DefaultEnvironmentName string `json:"defaultEnvironmentName"`
}
Config holds the multi-tenancy plugin configuration
type MembersListResponse ¶
MembersListResponse represents a list of members
type MultitenancyErrorResponse ¶
type MultitenancyErrorResponse struct {
Error string `json:"error" example:"Error message"`
}
MultitenancyErrorResponse represents an error response
type MultitenancyStatusResponse ¶
type MultitenancyStatusResponse struct {
Status string `json:"status" example:"success"`
}
MultitenancyStatusResponse represents a status response
type Plugin ¶
type Plugin struct {
// contains filtered or unexported fields
}
Plugin implements the multi-tenancy plugin
func NewPlugin ¶
func NewPlugin(opts ...PluginOption) *Plugin
NewPlugin creates a new multi-tenancy plugin instance with optional configuration
func (*Plugin) RegisterHooks ¶
func (p *Plugin) RegisterHooks(hooks *hooks.HookRegistry) error
RegisterHooks registers the plugin's hooks
func (*Plugin) RegisterRoutes ¶
RegisterRoutes registers the plugin's HTTP routes
func (*Plugin) RegisterServiceDecorators ¶
func (p *Plugin) RegisterServiceDecorators(services *registry.ServiceRegistry) error
RegisterServiceDecorators replaces core services with multi-tenant aware versions
type PluginOption ¶
type PluginOption func(*Plugin)
PluginOption is a functional option for configuring the plugin
func WithDefaultAppName ¶
func WithDefaultAppName(name string) PluginOption
WithDefaultAppName sets the default app name
func WithDefaultConfig ¶
func WithDefaultConfig(cfg Config) PluginOption
WithDefaultConfig sets the default configuration for the plugin
func WithEnableAppCreation ¶
func WithEnableAppCreation(enabled bool) PluginOption
WithEnableAppCreation sets whether app creation is enabled
func WithInvitationExpiryHours ¶
func WithInvitationExpiryHours(hours int) PluginOption
WithInvitationExpiryHours sets the invitation expiry hours
func WithMaxMembersPerApp ¶
func WithMaxMembersPerApp(max int) PluginOption
WithMaxMembersPerApp sets the maximum members per app
func WithMaxTeamsPerApp ¶
func WithMaxTeamsPerApp(max int) PluginOption
WithMaxTeamsPerApp sets the maximum teams per app
func WithPlatformAppID ¶
func WithPlatformAppID(id xid.ID) PluginOption
WithPlatformAppID sets the platform app ID
func WithRequireInvitation ¶
func WithRequireInvitation(required bool) PluginOption
WithRequireInvitation sets whether invitation is required
type TeamsListResponse ¶
TeamsListResponse represents a list of teams