createuser

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: MIT Imports: 10 Imported by: ? 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.

Documentation

Overview

Package createuser is the sign-up of the multi mode: an account created by an invitation, or by anyone in the public mode. The first account of a base needs no invitation and runs the others (admin).

Index

Constants

View Source
const MaxName = 64

MaxName is the most characters of an account's name.

Variables

View Source
var (
	ErrNoName    = domain.Invalid("the account needs a name")
	ErrLongName  = domain.Invalid("the name of an account has at most 64 characters")
	ErrNameTaken = domain.Invalid("this name is taken")
	ErrBadInvite = domain.Forbidden("this invitation is unknown, used or expired")
)

Functions

func Process

func Process(ctx context.Context, db bun.IDB, input Input, public bool) *run

Process creates the account of input; public tells the public mode (domain.ServerMode.Public), where no invitation is needed.

Types

type Input

type Input struct {
	Name     string `json:"name"`
	Password string `json:"password"`
	Invite   string `json:"invite,omitempty" binding:"optional"`
}

Input is a sign-up. Invite is the token of an invitation, needed in the invitation mode.

Jump to

Keyboard shortcuts

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