New capability interfaces: - menus.Menus: menu/nav access (GetMenuByName, GetMenuItems) - subscriptions.Subscriptions: tier/plan access (GetUserTierLevel, GetTierBySlug, ListActivePlans) - auth.PublicUsers: public user profiles (GetByUsername, GetByID) - plugin.PluginBridge: inter-plugin service registry with typed GetServiceAs[T] helper All added to ServiceDeps for plugin consumption. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
35 lines
704 B
Go
35 lines
704 B
Go
package menus
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/google/uuid"
|
|
)
|
|
|
|
// Menus provides menu and navigation access for plugins.
|
|
type Menus interface {
|
|
GetMenuByName(ctx context.Context, name string) (*Menu, error)
|
|
GetMenuItems(ctx context.Context, menuID uuid.UUID) ([]MenuItem, error)
|
|
}
|
|
|
|
// Menu represents a named navigation menu.
|
|
type Menu struct {
|
|
ID uuid.UUID
|
|
Name string
|
|
}
|
|
|
|
// MenuItem represents a single entry in a navigation menu.
|
|
type MenuItem struct {
|
|
ID uuid.UUID
|
|
MenuID uuid.UUID
|
|
Label string
|
|
URL string
|
|
PageSlug string
|
|
ParentID *uuid.UUID
|
|
SortOrder int32
|
|
OpenInNewTab bool
|
|
CssClass string
|
|
ItemType string
|
|
Icon string
|
|
}
|