user

package
v4.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const UnknownUser = "UNKNOWN"

Variables

View Source
var ErrUnknownUser = errors.New("unknown user")

Functions

func IDToUsername

func IDToUsername(id string, clients *api.Clients) string

ID to Username returns the username for a given user BSON ID, if possible. If the username cannot be resolved, const UnknownUser is returned. This method is intended for displaying a friendly username instead of a BSON ID.

func UsernameToID

func UsernameToID(user string, clients *api.Clients) (uid string, err error)

UsernameToID translates a non-BSON ID string to the BSON ID of that user, if possible. If the provided string is a BSON ID already, it is returned directly. If the user ID for the provided username cannot be found an error is returned.

Types

This section is empty.

Jump to

Keyboard shortcuts

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