Documentation ¶
Index ¶
- Variables
- func Mask(phone string) string
- func MaskWithCustomRune(phone string, r rune) string
- func Parse_IsPossibleNumber_ReturnE164(userInput string) (e164 string, err error)
- func Require_IsPossibleNumber_IsValidNumber_UserInputInE164(userInput string) error
- type Country
- type ParsedPhoneNumber
- func (n ParsedPhoneNumber) IsNorthAmericaNumber() bool
- func (n ParsedPhoneNumber) RequireIsPossibleNumber() error
- func (n ParsedPhoneNumber) RequireIsValidNumber() error
- func (n ParsedPhoneNumber) RequireUserInputInE164() error
- func (n ParsedPhoneNumber) Require_IsPossibleNumber_IsValidNumber_UserInputInE164() error
Constants ¶
This section is empty.
Variables ¶
View Source
var AllAlpha2 []string
View Source
var AllCountries []Country
View Source
var ErrNotInE164Format = errors.New("not in E.164 format")
ErrNotInE164Format means the given phone number is not in E.164 format.
View Source
var ErrPhoneNumberInvalid = errors.New("invalid phone number")
ErrPhoneNumberInvalid means phone number doesn't pass validation
View Source
var JSONSchemaString string
Functions ¶
func MaskWithCustomRune ¶
MaskWithCustomRune masks the give phone number with specific rune.
Types ¶
type ParsedPhoneNumber ¶
type ParsedPhoneNumber struct { UserInput string E164 string Alpha2 string IsPossibleNumber bool IsValidNumber bool CountryCallingCodeWithoutPlusSign string NationalNumberWithoutFormatting string }
func ParsePhoneNumberWithUserInput ¶
func ParsePhoneNumberWithUserInput(userInput string) (*ParsedPhoneNumber, error)
func (ParsedPhoneNumber) IsNorthAmericaNumber ¶
func (n ParsedPhoneNumber) IsNorthAmericaNumber() bool
func (ParsedPhoneNumber) RequireIsPossibleNumber ¶
func (n ParsedPhoneNumber) RequireIsPossibleNumber() error
func (ParsedPhoneNumber) RequireIsValidNumber ¶
func (n ParsedPhoneNumber) RequireIsValidNumber() error
func (ParsedPhoneNumber) RequireUserInputInE164 ¶
func (n ParsedPhoneNumber) RequireUserInputInE164() error
func (ParsedPhoneNumber) Require_IsPossibleNumber_IsValidNumber_UserInputInE164 ¶
func (n ParsedPhoneNumber) Require_IsPossibleNumber_IsValidNumber_UserInputInE164() error
Click to show internal directories.
Click to hide internal directories.