Documentation
¶
Index ¶
Constants ¶
View Source
const ( EventTenantCreated = "tenant.created" EventTenantUpdated = "tenant.updated" EventTenantDeleted = "tenant.deleted" EventTenantMemberAdded = "tenant.member.added" EventTenantMemberRemoved = "tenant.member.removed" )
Event topic constants.
Variables ¶
View Source
var ( ErrTenantNotFound = errors.New("tenant not found") ErrTenantCodeExists = errors.New("tenant code already exists") ErrInvalidTenant = errors.New("invalid tenant data") ErrMemberExists = errors.New("user is already a member") ErrMemberNotFound = errors.New("membership not found") ErrPlatformDomainOnly = errors.New("operation requires platform domain") ErrParentTenantInvalid = errors.New("invalid parent tenant") )
Tenant errors.
Functions ¶
This section is empty.
Types ¶
type MemberEventData ¶
type MemberEventData struct {
TenantID uuid.UUID `json:"tenantId"`
UserID uuid.UUID `json:"userId"`
Role string `json:"role"`
ActorID uuid.UUID `json:"actorId"`
}
MemberEventData is the payload for membership events.
type RoleSeeder ¶
RoleSeeder seeds baseline roles for a new tenant domain.
type TenantEventData ¶
type TenantEventData struct {
TenantID uuid.UUID `json:"tenantId"`
TenantCode string `json:"tenantCode"`
DomainID uuid.UUID `json:"domainId"`
ActorID uuid.UUID `json:"actorId"`
}
TenantEventData is the payload for tenant lifecycle events.
type TenantInfo ¶
type TenantInfo struct {
ID uuid.UUID `json:"id"`
Code string `json:"code"`
Name string `json:"name"`
Status string `json:"status"`
DomainID uuid.UUID `json:"domainId"`
}
TenantInfo is the cross-plugin tenant summary.
type TenantServiceAPI ¶
type TenantServiceAPI interface {
GetTenant(ctx context.Context, id uuid.UUID) (*TenantInfo, error)
GetTenantByCode(ctx context.Context, code string) (*TenantInfo, error)
IsMember(ctx context.Context, tenantID, userID uuid.UUID) (bool, error)
GetDomainID(ctx context.Context, tenantCode string) (uuid.UUID, error)
}
TenantServiceAPI is the public interface exposed to other plugins. Consumers resolve it via: plugin.Resolve[TenantServiceAPI](services, "tenant.service")
Click to show internal directories.
Click to hide internal directories.