query

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2026 License: MIT Imports: 10 Imported by: 0

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

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

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

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

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

Query returns the profile for the supplied identifiers.

type ProfileQueryInput

type ProfileQueryInput struct {
	UserID uuid.UUID
	Scope  types.ScopeFilter
	Actor  types.ActorRef
}

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

Query returns assignments from the registry.

type RoleDetailInput

type RoleDetailInput struct {
	RoleID uuid.UUID
	Scope  types.ScopeFilter
	Actor  types.ActorRef
}

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

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

Query delegates to the configured repository after normalizing filters.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL