Help us shape the future of Go! Take the 2026 Go Developer Survey

user

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

README

User module

modules/user is the people in a tenant: one entity, a rest.Spec at /api/v1/user/users guarded by user:read and user:manage, invitations at /api/v1/user/invitations, explicit lifecycle commands, and pending registrations for compositions that want operator approval (user:approve guards the approve-registration command). A user belongs to a tenant by carrying its id, which row-level security matches on, so the module takes no dependencies: user.Deps{}.

Provision is what platformkit bootstrap calls to create the first administrator with a password; the argon2id parameters are constants here. Consumers import contracts/ — users, registration, password rules, events, permissions and the fake — never internal/. The admin entry is /admin/user/users.

Documentation

Overview

Package user is the module manifest: the people in a tenant.

It is the exemplar's shape with one entity, one Spec and explicit lifecycle commands, and it takes no dependencies at all: a user belongs to a tenant by carrying its id, which row-level security matches on, so there is nothing for this module to ask the tenant module for.

Index

Constants

This section is empty.

Variables

View Source
var Migrations = db.MigrationSource{
	Owner:  "user",
	Files:  db.Sub(schema, "migrations"),
	Adopts: []db.Adoption{{Owner: "platformkit", Versions: []int64{7}}},
}

Migrations is this module's SQL as one source — the users table — owned as "user". The manifest hands the kernel the same files and adoption, and a test composes the schema it needs beside the foundation: dbtest.Schema(t, user.Migrations).

The files keep the version numbers they had when the foundation applied them under its own name, so an installation migrated before this module owned its SQL is adopted by checksum rather than migrated again (see db.Adoption and docs/adr/0011). New files continue from the highest number.

Functions

func Module

func Module(_ Deps) (contracts.Service, module.Module)

Module is the manifest, and the service it is built on: the auth module takes this value from main, because signing somebody in means finding them first.

Types

type Deps

type Deps struct{}

Deps is what this module cannot make for itself, and it is empty. That is worth a struct rather than no parameter: the day it needs something, every call site gains a named field instead of a new argument.

Directories

Path Synopsis
Package contracts is everything another module, an app or a test may know about users: the entity, the events, the permissions and the Service interface.
Package contracts is everything another module, an app or a test may know about users: the entity, the events, the permissions and the Service interface.
usertest
Package usertest is the conformance suite for contracts.Service, and a fake that passes it.
Package usertest is the conformance suite for contracts.Service, and a fake that passes it.
Package internal is every implementation of the user module.
Package internal is every implementation of the user module.

Jump to

Keyboard shortcuts

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