Documentation
¶
Index ¶
Constants ¶
View Source
const UnknownUser = "UNKNOWN"
Variables ¶
View Source
var ErrUnknownUser = errors.New("unknown user")
Functions ¶
func IDToUsername ¶
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 ¶
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.
Click to show internal directories.
Click to hide internal directories.