initial commit

This commit is contained in:
m.zare
2026-04-10 18:25:21 +03:30
commit 77ca6c34a3
263 changed files with 34470 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
package auth
// UserQueryOption represents options for querying users
type UserQueryOption func(*UserQueryOptions)
// UserQueryOptions holds options for user queries
type UserQueryOptions struct {
LoadRoles bool
LoadAccounts bool
}
// WithRoles enables loading of user roles
func WithRoles() UserQueryOption {
return func(opts *UserQueryOptions) {
opts.LoadRoles = true
}
}
// WithAccounts enables loading of user accounts
func WithAccounts() UserQueryOption {
return func(opts *UserQueryOptions) {
opts.LoadAccounts = true
}
}
// WithRelations enables loading of all relations
func WithRelations() UserQueryOption {
return func(opts *UserQueryOptions) {
opts.LoadRoles = true
opts.LoadAccounts = true
}
}