kbun

package
v0.0.0-...-c5434ca Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: BSD-3-Clause Imports: 2 Imported by: 69

Documentation

Index

Constants

View Source
const UsernameRE = `(?:[a-zA-Z0-9]+_?)+`

UsernameRE is the regex for matching usernames. Underscores are allowed, just not first or doubled.

Variables

This section is empty.

Functions

func CheckUsername

func CheckUsername(s string) bool

CheckUsername returns true if the given string can be a Keybase username.

Types

type NormalizedUsername

type NormalizedUsername string

NormalizedUsername is a Keybase username that has been normalized (toLowered) and therefore will compare correctly against other normalized usernames.

func NewNormalizedUsername

func NewNormalizedUsername(s string) NormalizedUsername

NewNormalizedUsername makes a normalized username out of a non-normalized plain string username

func (NormalizedUsername) Eq

Eq returns true if the given normalized usernames are equal

func (NormalizedUsername) IsNil

func (n NormalizedUsername) IsNil() bool

IsNil returns true if the username is the empty string

func (NormalizedUsername) IsValid

func (n NormalizedUsername) IsValid() bool

IsValid returns CheckUsername(n.String()).

func (NormalizedUsername) String

func (n NormalizedUsername) String() string

String returns the normalized username as a string (in lower case)

Jump to

Keyboard shortcuts

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