Documentation
¶
Overview ¶
Package query hosts read-side projections and DTO-friendly query helpers consumed by go-admin/go-cms dashboards. Each query implementation should be transport-agnostic and accept injected repositories.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActivityFeedQuery ¶
type ActivityFeedQuery struct {
// contains filtered or unexported fields
}
ActivityFeedQuery renders paginated activity feeds for dashboards.
func NewActivityFeedQuery ¶
func NewActivityFeedQuery(repo types.ActivityRepository, guard scope.Guard, opts ...ActivityQueryOption) *ActivityFeedQuery
NewActivityFeedQuery constructs the feed query helper.
func (*ActivityFeedQuery) Query ¶
func (q *ActivityFeedQuery) Query(ctx context.Context, filter types.ActivityFilter) (types.ActivityPage, error)
Query fetches a page of activity logs via the injected repository.
type ActivityQueryOption ¶ added in v0.10.0
type ActivityQueryOption func(*activityQueryConfig)
ActivityQueryOption customizes activity query behavior.
func WithActivityAccessPolicy ¶ added in v0.10.0
func WithActivityAccessPolicy(policy activity.ActivityAccessPolicy) ActivityQueryOption
WithActivityAccessPolicy attaches a policy to activity queries.
type ActivityStatsQuery ¶
type ActivityStatsQuery struct {
// contains filtered or unexported fields
}
ActivityStatsQuery aggregates activity counts per verb.
func NewActivityStatsQuery ¶
func NewActivityStatsQuery(repo types.ActivityRepository, guard scope.Guard, opts ...ActivityQueryOption) *ActivityStatsQuery
NewActivityStatsQuery constructs the stats helper.
func (*ActivityStatsQuery) Query ¶
func (q *ActivityStatsQuery) Query(ctx context.Context, filter types.ActivityStatsFilter) (types.ActivityStats, error)
Query returns aggregate counts for UI widgets.
type PreferenceQuery ¶
type PreferenceQuery struct {
// contains filtered or unexported fields
}
PreferenceQuery resolves effective preferences via the injected resolver.
func NewPreferenceQuery ¶
func NewPreferenceQuery(resolver preferenceResolver, guard scope.Guard) *PreferenceQuery
NewPreferenceQuery constructs the query helper.
func (*PreferenceQuery) Query ¶
func (q *PreferenceQuery) Query(ctx context.Context, input PreferenceQueryInput) (types.PreferenceSnapshot, error)
Query resolves preferences for the provided scope chain.
type PreferenceQueryInput ¶
type PreferenceQueryInput struct {
UserID uuid.UUID
Scope types.ScopeFilter
Levels []types.PreferenceLevel
Keys []string
Base map[string]any
Actor types.ActorRef
}
PreferenceQueryInput scopes preference resolution.
func (PreferenceQueryInput) Type ¶
func (PreferenceQueryInput) Type() string
Type implements gocommand.Message.
func (PreferenceQueryInput) Validate ¶
func (input PreferenceQueryInput) Validate() error
Validate implements gocommand.Message.
type ProfileQuery ¶
type ProfileQuery struct {
// contains filtered or unexported fields
}
ProfileQuery fetches user profile records.
func NewProfileQuery ¶
func NewProfileQuery(repo types.ProfileRepository, guard scope.Guard) *ProfileQuery
NewProfileQuery constructs the profile query helper.
func (*ProfileQuery) Query ¶
func (q *ProfileQuery) Query(ctx context.Context, input ProfileQueryInput) (*types.UserProfile, error)
Query returns the profile for the supplied identifiers.
type ProfileQueryInput ¶
ProfileQueryInput scopes profile lookups.
func (ProfileQueryInput) Type ¶
func (ProfileQueryInput) Type() string
Type implements gocommand.Message.
func (ProfileQueryInput) Validate ¶
func (input ProfileQueryInput) Validate() error
Validate implements gocommand.Message.
type RoleAssignmentsQuery ¶
type RoleAssignmentsQuery struct {
// contains filtered or unexported fields
}
RoleAssignmentsQuery lists role assignments filtered by scope/user/role.
func NewRoleAssignmentsQuery ¶
func NewRoleAssignmentsQuery(registry types.RoleRegistry, guard scope.Guard) *RoleAssignmentsQuery
NewRoleAssignmentsQuery constructs the query helper.
func (*RoleAssignmentsQuery) Query ¶
func (q *RoleAssignmentsQuery) Query(ctx context.Context, filter types.RoleAssignmentFilter) ([]types.RoleAssignment, error)
Query returns assignments from the registry.
type RoleDetailInput ¶
RoleDetailInput fetches a single role by ID.
func (RoleDetailInput) Type ¶
func (RoleDetailInput) Type() string
Type implements gocommand.Message.
func (RoleDetailInput) Validate ¶
func (input RoleDetailInput) Validate() error
Validate implements gocommand.Message.
type RoleDetailQuery ¶
type RoleDetailQuery struct {
// contains filtered or unexported fields
}
RoleDetailQuery loads custom role metadata.
func NewRoleDetailQuery ¶
func NewRoleDetailQuery(registry types.RoleRegistry, guard scope.Guard) *RoleDetailQuery
NewRoleDetailQuery constructs the detail query.
func (*RoleDetailQuery) Query ¶
func (q *RoleDetailQuery) Query(ctx context.Context, input RoleDetailInput) (*types.RoleDefinition, error)
Query fetches role detail.
type RoleListQuery ¶
type RoleListQuery struct {
// contains filtered or unexported fields
}
RoleListQuery lists custom roles for admin surfaces.
func NewRoleListQuery ¶
func NewRoleListQuery(registry types.RoleRegistry, guard scope.Guard) *RoleListQuery
NewRoleListQuery builds the list query.
func (*RoleListQuery) Query ¶
func (q *RoleListQuery) Query(ctx context.Context, filter types.RoleFilter) (types.RolePage, error)
Query forwards to the registry.
type UserInventoryQuery ¶
type UserInventoryQuery struct {
// contains filtered or unexported fields
}
UserInventoryQuery wraps ListUsers repositories and normalizes filters for admin dashboards.
func NewUserInventoryQuery ¶
func NewUserInventoryQuery(repo types.UserInventoryRepository, logger types.Logger, guard scope.Guard) *UserInventoryQuery
NewUserInventoryQuery constructs the query helper.
func (*UserInventoryQuery) Query ¶
func (q *UserInventoryQuery) Query(ctx context.Context, filter types.UserInventoryFilter) (types.UserInventoryPage, error)
Query delegates to the configured repository after normalizing filters.