users

package module
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: MIT Imports: 6 Imported by: 2 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

modules/users

Official Lesstruct module: user management — admin user lifecycle (pending approval, suspension, soft delete with content restore, admin creation), self-service profile (email, password, name, custom fields, data export, account deletion), and profile pictures, all behind async-tolerant admin handlers.

Layout (module template)

module.go            # kernel.Module (single registry-facing file)
api/                 # browser handlers (agent UPPER_SNAKE envelope) + seams
domain/              # UserManagement/Profile/AccountDeletion/AdminCreation services (4.0b)
domain/profilepicture/ # profile picture service, processor, kernel-storage seam (4.0e)
admin/               # admin-shell manifest (empty: Users nav is static SPA chrome)
testutil/            # kernel fixture for module tests

Handlers

The api.UserManagementHandler serves the admin user lifecycle; api.ProfileHandler serves self-service profile; api.ProfilePictureHandler serves picture upload/delete for self and admin. All three write through kernel/httpx (byte-identical to the pre-module internal/api/response writers by contract). Account emails flow through the Mailer seam (the six user-management sends); soft-delete reads flow through the SoftDeleteStore seam (core adapter converts database null types at the boundary); handler user lookups flow through the narrow UserStore seam (the core user repository satisfies it structurally). The pre-module jwtManager fields were dead weight (stored, never called) and were dropped with zero behavior change.

Documentation

Overview

Package users is the official user management module: admin user management (approval, suspension, soft delete, admin creation), self-service profile (email, password, name, custom fields, data export, account deletion), and profile pictures over the handler surface core mounts explicitly.

Index

Constants

View Source
const Name = "users"

Name is the registry key for this module.

View Source
const Version = "0.1.0"

Version is the module version reported via Module.Version.

Variables

This section is empty.

Functions

This section is empty.

Types

type Module

type Module struct {
	// contains filtered or unexported fields
}

Module is the users kernel module.

func New

func New(opts ...Option) *Module

New builds the module, adopting the composition root's wiring. The handlers are built once here so every realm serves the same instances.

func (*Module) AdminManifest

func (m *Module) AdminManifest() kernel.AdminExtensionManifest

AdminManifest declares this module's admin-shell extensions. The Users navigation surface is static SPA chrome today, so the module declares no menu entries, settings sections, or editor extensions.

func (*Module) Init

func (m *Module) Init(_ kernel.Kernel) error

Init wires the module. The handlers are already built by New; Init only validates presence.

func (*Module) Name

func (m *Module) Name() string

Name returns the registry key.

func (*Module) Optional

func (m *Module) Optional() []string

Optional lists soft dependencies. There are none: every collaborator is either adopted or required.

func (*Module) ProfileHandler

func (m *Module) ProfileHandler() *api.ProfileHandler

ProfileHandler exposes the self-service profile handler for core mounting. Same explicit-mount deviation as the management surface.

func (*Module) ProfilePictureHandler

func (m *Module) ProfilePictureHandler() *api.ProfilePictureHandler

ProfilePictureHandler exposes the profile picture handler for core mounting. Same explicit-mount deviation as the management surface.

func (*Module) Requires

func (m *Module) Requires() []string

Requires lists hard dependencies. Users is a leaf: every collaborator is adopted, matching the retired wrapper edge.

func (*Module) Shutdown

func (m *Module) Shutdown() error

Shutdown releases module resources. There are none beyond memory.

func (*Module) UserManagementHandler

func (m *Module) UserManagementHandler() *api.UserManagementHandler

UserManagementHandler exposes the user management handler for core mounting. Core mounts it explicitly (rather than via RouteProvider) because the surface spans the admin group, which a single RegisterRoutes call cannot express.

func (*Module) Version

func (m *Module) Version() string

Version returns the module version.

type Option

type Option func(*Module)

Option configures a Module. The composition root supplies every option; direct construction without options yields a standalone module whose handlers serve nil services (they must not be invoked unconfigured).

func WithAccountDeletionService

func WithAccountDeletionService(service *userdomain.AccountDeletionService) Option

WithAccountDeletionService adopts the account deletion service.

func WithAdminCreateUserService

func WithAdminCreateUserService(service *userdomain.AdminCreateUserService) Option

WithAdminCreateUserService adopts the admin user creation service.

func WithLogger

func WithLogger(logger kernel.Logger) Option

WithLogger attaches the module logger. Without one handler failures are dropped (discard sink).

func WithMailer

func WithMailer(mailer api.Mailer) Option

WithMailer adopts the account-email mailer.

func WithProfilePictureService

func WithProfilePictureService(service *profilepicture.Service) Option

WithProfilePictureService adopts the profile picture service.

func WithProfilePictureURLBuilder

func WithProfilePictureURLBuilder(builder func(string) string) Option

WithProfilePictureURLBuilder adopts the filename-to-URL builder.

func WithProfileService

func WithProfileService(service *userdomain.ProfileService) Option

WithProfileService adopts the self-service profile service.

func WithSoftDeleteStore

func WithSoftDeleteStore(store api.SoftDeleteStore) Option

WithSoftDeleteStore adopts the soft-delete store.

func WithUserFieldsProvider

func WithUserFieldsProvider(provider UserFieldsProvider) Option

WithUserFieldsProvider adopts the user field schema provider for self-service profile editing.

func WithUserManagementService

func WithUserManagementService(service *userdomain.UserManagementService) Option

WithUserManagementService adopts the admin user management service.

func WithUserStore

func WithUserStore(store api.UserStore) Option

WithUserStore adopts the user store for handler-level lookups.

type UserFieldsProvider

type UserFieldsProvider interface {
	GetUserFields() []customfield.FieldSchema
	GetUserSystemFields() []customfield.FieldSchema
}

UserFieldsProvider provides user field schema access for self-service profile editing. The core post-type service satisfies it structurally.

Directories

Path Synopsis
Package admin owns this module's admin-shell manifest: the declarative UI the single admin SPA renders for user management.
Package admin owns this module's admin-shell manifest: the declarative UI the single admin SPA renders for user management.
api
Package testutil provides the kernel fixture module tests run against.
Package testutil provides the kernel fixture module tests run against.

Jump to

Keyboard shortcuts

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