kbun

package
v0.0.0-...-f10651d Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2024 License: BSD-3-Clause Imports: 2 Imported by: 71

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